Skip to main content
Use --backend-only to run the backend on a remote machine, then connect from your local frontend with --frontend-only.
The agent server can read and write the host filesystem, execute shell commands, and access the network. Lock down the machine before starting.

1. Provision and Secure the Machine

Any always-on Linux or macOS host:
  • Cloud VM — Ubuntu 24.04 LTS, 2 vCPU / 4 GB RAM is enough for a single user.
  • Dedicated hardware — Mac Mini, Intel NUC, spare laptop.
Lock down inbound traffic before starting the backend:
  • Port 22 (SSH) — your IP or VPN CIDR only.
  • Everything else — drop.

2. Install Prerequisites

On Ubuntu:
On macOS, install Node and uv via Homebrew instead.

3. Start the Backend

  • --backend-only starts only the backend (no frontend).
  • --public requires LOCAL_BACKEND_API_KEY — every API request must carry a matching X-Session-API-Key header.
To also serve the UI from the VM (e.g. to access it from a phone), drop --backend-only. With the full stack, --public requires users to enter the API key in the UI before interacting with the agent.

4. Connect from Your Local Machine

On your laptop, start the frontend:
Then add the VM as a backend:
  1. Click the backend switcher → Manage BackendsAdd Backend.
  2. Fill in:
    • Name — e.g. my-vm
    • Host / Base URLhttp://localhost:8000 (if using an SSH tunnel) or the VM’s URL if you’ve set up a reverse proxy
    • API Key — the LOCAL_BACKEND_API_KEY from step 3
  3. Save and select it as the active backend.

Using an SSH Tunnel

The simplest way to reach the backend without exposing ports:
Then use http://localhost:8000 as the backend URL.

5. (Optional) Add a Domain with nginx + TLS

If you want direct HTTPS access without an SSH tunnel, point a domain at the machine and front it with nginx + Let’s Encrypt.

Point a Domain at the Machine

Create an A record pointing to the machine’s public IP (e.g. canvas.example.com):

Open Ports 80 and 443

Update your network firewall to additionally allow:
  • Port 80 (HTTP) — open to 0.0.0.0/0 (required for Let’s Encrypt HTTP-01 challenges). nginx redirects all HTTP to HTTPS.
  • Port 443 (HTTPS) — restrict to your IP if possible. If you need it world-open, LOCAL_BACKEND_API_KEY is your primary defense.

Install nginx and Certbot

Configure nginx

Save this at /etc/nginx/sites-available/canvas.example.com, replacing the domain:
Enable the site and issue a certificate:

Verify

Use https://canvas.example.com as the Host / Base URL when adding the backend in Manage Backends.

Security Checklist

Before exposing the backend to a broader network:
  1. Restrict inbound network access — only open ports you need (SSH, 80/443 for the reverse proxy).
  2. Use --public mode with a strong LOCAL_BACKEND_API_KEY.
  3. Use TLS — put a reverse proxy in front with Let’s Encrypt if the backend is internet-reachable.
  4. Treat the host as sensitive infrastructure — it stores secrets, conversations, and working copies.