Documentation feedback

Help us improve this page.

About

We use submissions to improve Swarm and may reply if you include an email. Human verification is required. See our Privacy Policy.

Using Swarm

Host your Swarm

Hosting Swarm Agent is a great way to isolate the agent from your personal machine. You can connect to Swarm Agent over SSH in your terminal, open the server-hosted Desktop in a browser on your local machine through an SSH tunnel, or use Tailscale for private access.

Secure the host before installing Swarm Agent

Hosting Swarm Agent introduces security risks. It is critical to take the following steps to secure your machine before installing Swarm Agent.

Prepare the server.

Start with a Linux x86_64 server that you administer over SSH. Apply operating-system security updates, use key-based SSH authentication, and restrict inbound traffic before installing Swarm.

Recommended baseline

Secure the VPS before you install agents

Treat an agent host like any other privileged development machine: it can read the workspaces and use the credentials you authorize. Start with a dedicated, supported VPS, install security updates, create a non-root administrator with key-based SSH, and disable password and direct root login after confirming your replacement login works.

01

Deny inbound traffic by default

Do not open Swarm's backend or Desktop ports. Swarm binds them to 127.0.0.1 by default, so they are not reachable from the public network.

02

Restrict SSH port 22

Allow it only from your current public IP, a trusted VPN, or a private overlay such as Tailscale. Prefer the VPS provider's firewall for the outer rule because you can update or recover it from the provider console without first reaching the server.

03

Avoid accidental lockout

If UFW restricts SSH to one source IP and that IP changes, you will lose SSH access. Keep a tested provider-console recovery path, confirm a second SSH session before closing the first, and update the allowlist before removing the old rule.

04

Keep Swarm's storage private

Swarm creates its configuration, data, cache, and runtime directories for the service owner with restrictive permissions. Configured provider API keys and OAuth tokens are sealed in the private credential store rather than saved as plaintext records; the separate local encryption key is service-user-owned and mode 0600. This protects data at rest, but it cannot protect credentials after a root-level host compromise.

Need another isolation boundary?

A dedicated VPS or VM is the recommended supported path. Running Swarm inside a container on that server can add process and filesystem isolation, but it is an advanced, self-managed deployment rather than Swarm's standard installer and systemd path. A container is not automatically safer: run it rootless where possible, drop unnecessary capabilities, mount only the workspaces it needs, keep listeners on loopback, and persist and back up the required Swarm storage. Do not expose container ports publicly.

Install Swarm Remote.

Connect to the server over SSH and run the same latest-release installer used for a local installation. You do not need to clone the source repository.

curl -fsSL https://swarmagent.dev/install | sh

The installer shows its plan before making changes and may request sudo because it installs the launcher and runtime in system locations. It then asks whether to install the systemd service, install files only, or cancel.

Choose how Swarm runs.

Choose the systemd service for a server. The service option installs, enables, and starts swarm.service. Swarm then runs without an open SSH session, starts again after a reboot, and can be managed with the normal launcher commands.

1systemd serviceRecommended for 24/7 server

The installer enables and starts swarm.service, and systemd restores it automatically after server reboots.

2Files onlyManual supervisor

For testing or operators who already have another supervisor. Swarm installs without starting a service; you own startup, restart, and reboot behavior.

Verification

Confirm active service state

After choosing systemd, verify that the installed daemon is active and healthy:

swarm status

If you initially chose files only, the installed launcher can add and start the service later with swarm install --service.

Connect securely.

SSH directly to the host to use the Swarm TUI in your terminal. For browser access, forward the loopback-only Desktop port through SSH, or use Tailscale from trusted devices. Keep Swarm's backend and Desktop listeners on 127.0.0.1.

SSH

Connect using your SSH host or alias:

ssh server-alias

Then start the TUI from the server prompt:

swarm

Swarm runs in that SSH terminal. Closing the SSH connection exits the TUI but does not stop the systemd-managed daemon.

Browser tunnel

Forward the server's loopback Desktop port to your workstation:

ssh -N -L 5555:127.0.0.1:5555 user@server

While the tunnel is open, visit the loopback address 127.0.0.1 on port 5555 from your workstation. Only SSH is exposed remotely; the Desktop listener remains on the server's loopback interface.

Private access from your devices

Using Tailscale

Tailscale creates a private network, called a tailnet, between the Swarm host and your trusted devices. Swarm stays on 127.0.0.1; Tailscale Serve provides the private HTTPS address you open from your computer or phone.

02

Install and sign in

Download Tailscale on the Swarm host and on each computer or phone that should connect, then sign in to the same tailnet.

03

Serve the Desktop port

On the Swarm host, forward its loopback-only Desktop listener through Tailscale Serve:

tailscale serve --bg 127.0.0.1:5555

If you changed desktop_port, use that port instead of 5555.

04

Open Swarm securely

Open the HTTPS *.ts.net address printed by Tailscale Serve from a signed-in device. The first visit asks you to approve that exact verified address in Swarm.

Swarm on mobile

Connect from iOS or Android

Tailscale has mobile apps for iOS and Android. Install the app, sign in to the same tailnet, connect Tailscale, and open your Swarm *.ts.net HTTPS address in the phone's browser. You can then install Swarm as a PWA for quicker access.

iOS

Open Swarm in Safari, tap Share, choose Add to Home Screen, turn on Open as Web App, then tap Add.

Android

Open Swarm in Chrome, tap More, choose Add to home screen, then Install and follow the prompts.

Use tailscale serve, not Tailscale Funnel. Funnel publishes a service to the internet and is not a supported Swarm Desktop access path.

Do not expose listeners directly

Do not bind Swarm to 0.0.0.0, publish ports 5555 or 7781, or place the daemon directly behind a public reverse proxy. Direct LAN or public HTTP access is not the supported secure path.

Operate the host.

Use Swarm's launcher rather than managing the unit directly for routine lifecycle work:

swarm status swarm restart swarm stop swarm start

Keep the server patched, review swarm status after a reboot or update, and back up the server storage appropriate to your environment. Closing swarm session, swarm open, or an SSH tunnel does not stop the systemd-managed daemon.

Continue to Configuration for the canonical Linux storage paths, default local ports, and advanced networking settings.