Self-hosting agentes.chat on your own Linux VPS gives you a private open-source (AGPL-3.0) workspace for AI agents with no license key and full control over your model credentials. In this guide you will deploy agentes.chat v0.1.12 with Docker Compose, PostgreSQL 18 + pgvector, the server itself configured as the agents' computer (browser and desktop), and automatic HTTPS via Tailscale (zero open ports) or Caddy on your own domain.
On this page
- Debian vs. Ubuntu and how much RAM to pick
- Architecture on a Linux VPS
- Prerequisites
- Option 1: install with Tailscale (private HTTPS, no domain)
- Option 2: public domain with Caddy (automatic HTTPS)
- Verify health, pair your phone and add AI keys
- Encrypted backups to S3/R2 and safe upgrades
- Four common pitfalls (and how to fix them)
- Want to skip the manual setup?
- Next steps
Every command, environment variable and container profile below was verified against the official v0.1.12 release of agentes-chat/agentes-chat (SELF_HOSTING.md, install.sh, docker-compose.yml and .env.example).
Debian vs. Ubuntu and how much RAM to pick
Two decisions before running the installer shape both security isolation and day-to-day stability: your Linux distribution and your memory budget.
Why Debian 12 or 13 is the recommended OS
agentes.chat supports both Debian and Ubuntu, but the agents' computer behaves differently on each:
- Debian 12 or 13 (recommended): Debian's
systemdincludesBPF_FRAMEWORK, allowing system mode (--system) to isolate each agent in its own Linux user. One agent cannot read another agent's files or processes. - Ubuntu 22.04 or 24.04: works in simple mode, where all agents share a single unprivileged
agentesuser (withoutsudo).
RAM, vCPU and disk sizing
The official baseline is 2 vCPU, 4 GB of RAM and 20 GB of disk (the Docker image alone is roughly 2 GB). However, if you enable the agents' computer on the same VPS with live desktops and Google Chrome, 4 GB runs tight fast:
| Linux VPS tier | Practical headroom with agentes.chat | Best fit |
|---|---|---|
| 4 GB RAM · 2 vCPU | Docker + Postgres 18 + agentes app with minimal browser use |
Quick evaluation or instances without a browser on the same server |
| 8 GB RAM · 4 vCPU | Full stack + agent desktops (~200 MB each) + Chrome browser (~600 MB open) | Recommended sweet spot for daily use with the agent browser |
| 12 GB+ · 6+ vCPU | Concurrent agents, local builds, plus optional speech or embeddings |
Small teams or heavier repositories and local voice transcription |
Architecture on a Linux VPS
By default, the official docker-compose.yml binds port 3000 to 127.0.0.1:3000 (loopback only) — never 0.0.0.0 — because Docker publishes ports through iptables past host firewalls like ufw. From there, you pick one entry profile in COMPOSE_PROFILES:
tailscaleprofile (default and safest): thetailscalecontainer (v1.102.5, userspace networkingTS_USERSPACE=true) joins your tailnet and serves real HTTPS athttps://agentes.<your-tailnet>.ts.netwith no custom domain and zero open ports on the public internet.httpsprofile (public domain): thecaddycontainer (2.11.7-alpine) exposes only ports80and443, obtains and renews a Let's Encrypt certificate, proxies HTTP and WebSockets, and serves an auto-reconnecting503page during restarts.

Alongside the app and Postgres (pgvector/pgvector:0.8.7-pg18 with shm_size: 1gb), the compose file ships three optional profiles disabled by default: backup (automated dumps to R2/S3 with optional age encryption), speech (local CPU voice transcription) and embeddings (local cross-language semantic search).
Prerequisites
- A 64-bit Linux VPS (Debian 12 or 13 recommended, or Ubuntu 22.04/24.04) with
rootSSH access and preferably 8 GB of RAM if you plan to run the agent browser. - Host firewall allowing
22/tcp(plus80/tcpand443TCP/UDP only if you use a public domain with Caddy). If you useufwwith Docker, see The Docker port stays open with ufw. - For Tailscale: a free Tailscale account with MagicDNS and HTTPS Certificates enabled under
console.tailscale.com/admin/dns. - For a public domain: a subdomain with a DNS
Arecord pointing to your VPS IPv4 (chat.example.com). - At least one AI model API key (Claude, OpenAI, Gemini, DeepSeek, OpenRouter or another supported provider), entered later in the web UI.
Option 1: install with Tailscale (private HTTPS, no domain)
This is the fastest and safest setup for solo use or a small team: nothing listens on public HTTP/HTTPS ports.
1. Prepare Tailscale and create an auth key
In the Tailscale admin console:
- Install Tailscale on your own computer and sign in (verify it shows up at
console.tailscale.com/admin/machines). - Open
console.tailscale.com/admin/dns, turn on MagicDNS and click Enable HTTPS under HTTPS Certificates. - Open
console.tailscale.com/admin/settings/keysand click Generate auth key. Leave Reusable and Ephemeral off, enable Pre-approved if shown, and copy the one-time key (tskey-auth-...).
2. Preview the installer plan and run it on the VPS
SSH into the VPS as root. You can inspect what the official installer will do first with --plan (dry run, makes no changes):
curl -fsSL https://agentes.chat/install | sh -s -- --planOnce verified, run the interactive setup:
curl -fsSL https://agentes.chat/install | shThe script ensures Docker Engine and Compose v2 (>= 2.23.1) are ready, fetches a SHA-256-verified Bun runtime and launches the setup wizard in /opt/agentes:
- Press Enter for Tailscale and paste your
tskey-auth-...key. - Press Enter to skip transactional email for now (or configure SMTP/Resend if you want email invites).
- Press Enter to configure this VPS as the agents' computer (installs
agentes-runner, virtual desktop support and Chrome for agents). - Choose whether to disable anonymous usage statistics.
The first run downloads roughly 2 GB and takes a few minutes. When it completes, it prints your private HTTPS URL and a QR code for the phone app:
◇ On your tailnet as agentes.tail1234.ts.net
◇ .env: PUBLIC_URL=https://agentes.tail1234.ts.net
◇ HTTPS certificate ready
◇ agentes.chat 0.1.12 is up
◇ Agents' computer: this machineOption 2: public domain with Caddy (automatic HTTPS)
If you want to reach your instance without installing Tailscale on client devices — or expose it on a company domain (https://chat.example.com) — use the built-in https profile with Caddy.
1. Boot on loopback and create the owner account first
One security rule matters before going public: the first account signed up becomes the instance owner and automatically closes open registration. Always create that owner account before exposing the domain.
Start the stack bound to 127.0.0.1:3000:
mkdir -p /opt/agentes && cd /opt/agentes
curl -fsSLO https://raw.githubusercontent.com/agentes-chat/agentes-chat/v0.1.12/docker-compose.yml
(umask 077 && printf 'AGENTES_IMAGE=ghcr.io/agentes-chat/agentes:0.1.12\nAGENTES_SECRET=%s\nPOSTGRES_PASSWORD=%s\nPUBLIC_URL=http://localhost:3000\n' "$(openssl rand -base64 48)" "$(openssl rand -hex 24)" > .env)
docker compose up -dFrom your local workstation, open a temporary SSH tunnel to port 3000:
ssh -N -L 3000:127.0.0.1:3000 root@YOUR_VPS_IPOpen http://localhost:3000 in your browser, create the owner account and confirm the dashboard loads. Then close the SSH tunnel (Ctrl+C).
2. Enable the https Caddy profile in .env
Make sure the A record for chat.example.com points to the VPS IPv4 and ports 80/tcp and 443 (TCP/UDP) are open. Update /opt/agentes/.env to set your public URL and profile:
DOMAIN=chat.example.com
PUBLIC_URL=https://chat.example.com
COMPOSE_PROFILES=httpsApply the change so Caddy obtains the Let's Encrypt certificate and restarts agentes with the new PUBLIC_URL:
cd /opt/agentes
docker compose up -d
docker compose psVerify health, pair your phone and add AI keys
Check on the VPS that the containers are healthy and /api/health responds on loopback:
cd /opt/agentes
docker compose ps
curl -fsS http://127.0.0.1:3000/api/healthIf you set up this VPS as the agents' computer, confirm the runner status:
agentes-runner statusThen open your HTTPS URL in the browser:
- Add model API keys under Settings → AI and usage (Claude, OpenAI, Gemini, DeepSeek, OpenRouter, etc.). Keys are encrypted at rest with a key derived from
AGENTES_SECRETand are never sent back to browsers. - Pair the mobile app (optional): open Settings → Your account → Open on your phone and scan the QR code from the agentes.chat app (make sure Tailscale is connected on the phone if using a tailnet). That one-time sign-in token expires in 3 minutes — only show it to your own phone.
- Connect a desktop computer (optional): download the desktop app from
/downloadon your instance, pick Use your own server and enter your HTTPS address.
Encrypted backups to S3/R2 and safe upgrades
A self-hosted agentes.chat instance consists of three things: the Postgres database, the files volume (/data/files) and AGENTES_SECRET in .env.
Enable the built-in backup service (Cloudflare R2 or S3)
Create a private bucket for dumps only and add its credentials to /opt/agentes/.env:
S3_ENDPOINT=https://<account-id>.r2.cloudflarestorage.com
S3_ACCESS_KEY_ID=your-access-key
S3_SECRET_ACCESS_KEY=your-secret-key
S3_BACKUP_BUCKET=agentes-backups
BACKUP_RETENTION_DAYS=14To encrypt every dump before it leaves the VPS (optional and recommended), generate an age key pair off the server (age-keygen -o key.txt) and put only the public recipient key in .env:
BACKUP_AGE_RECIPIENT=age1your-public-key-hereAdd backup to COMPOSE_PROFILES (for example COMPOSE_PROFILES=tailscale,backup or COMPOSE_PROFILES=https,backup), reload Compose and run a first manual check:
cd /opt/agentes
docker compose up -d
docker compose run --rm backup now
docker compose run --rm backup listThe backup service dumps only the PostgreSQL database (pg_dump). Uploaded files stored in the files volume (/data/files) need their own archive (unless you store attachments in an S3 bucket):
cd /opt/agentes
(umask 077 && docker compose run --rm --no-deps -T --entrypoint tar agentes czf - -C /data/files . > "files-$(date +%F).tar.gz")Upgrading without losing settings
Keep all configuration in .env (or a docker-compose.override.yml) instead of editing docker-compose.yml. For each new release on github.com/agentes-chat/agentes-chat/releases, take a dump first, download that release's docker-compose.yml, bump AGENTES_IMAGE in .env if pinned, and run migrations before starting the new container:
cd /opt/agentes
RELEASE=vX.Y.Z # replace with the target release tag
docker compose run --rm backup now # if the backup profile is enabled
curl -fsSLO "https://raw.githubusercontent.com/agentes-chat/agentes-chat/${RELEASE}/docker-compose.yml"
docker compose pull
docker compose run --rm agentes migrate
docker compose up -dDatabase migrations are forward-only: an older image refuses to start against a database already migrated by a newer build.
Four common pitfalls (and how to fix them)
| Symptom / log error | Root cause | Fix |
|---|---|---|
"Invalid origin" on sign-in or bad_origin on save |
PUBLIC_URL in .env does not match the exact scheme, host and port in the browser |
Update PUBLIC_URL (use the .ts.net hostname, not the 100.x IP) and run docker compose up -d |
Live messages stop and WebSocket closes with 1006 |
External proxy strips WebSocket upgrades for /api/ws, /api/machines/connect, /api/desktop, /api/terminal or /api/machines/stream |
Use the bundled Caddy/Tailscale profile or forward Upgrade/Connection over HTTP/1.1 (read_timeout >= 60s) |
extension "vector" is not available |
Plain Postgres image without pgvector |
Use pgvector/pgvector:0.8.7-pg18 from the official compose file (or install pgvector on external Postgres) |
| Agent reports Google Chrome failed to start | Too little RAM (< 8 GB under browser load) or missing Chrome system libraries | Check dmesg -T | grep -i oom and agentes-runner status; re-run the --system install if system libraries are missing |
Want to skip the manual setup?
If you prefer starting with Docker, Postgres 18 with pgvector, agentes.chat bound to 127.0.0.1:3000 and the agents' computer already provisioned on Debian 13 at first boot, Nuvits offers it preinstalled at no extra charge on VPS for agentes.chat — complete with a client-side command helper in the dashboard for Tailscale or Caddy HTTPS. Nuvits provides independent VPS hosting with the open-source project preinstalled and is not the official agentes.chat Cloud service.
Next steps
- Compare Debian and Ubuntu plans with 8 GB or 12 GB of RAM on VPS for agentes.chat and Linux VPS.
- Running a custom domain behind Caddy and seeing
502or TLS failures? Read Fix Caddy 502 Bad Gateway and HTTPS errors with Docker. - Want a private local LLM on your own VPS alongside your agents? Check How to install Ollama and Open WebUI on a Linux VPS.