A single Docker image for running the Agentio Gateway with three deployment modes:
| Mode | Use Case | Ports Required |
|---|---|---|
| Cloudflare Tunnel | Behind NAT, no public IP | None |
| Caddy | Public server with domain | 443 |
| Plain HTTP | Local dev, external proxy | 7890 |
Export your agentio configuration locally:
agentio config exportThis outputs two environment variables:
AGENTIO_KEY- Encryption key (64 hex characters)AGENTIO_CONFIG- Encrypted configuration blob
From the repository root:
docker build -f docker/Dockerfile -t agentio-gateway .Best for: Servers behind NAT, home labs, no public IP needed.
- Create a tunnel in Cloudflare Zero Trust Dashboard
- Configure the tunnel to point to
http://localhost:7890 - Copy the tunnel token
docker run -d \
--name agentio-gateway \
-e AGENTIO_KEY=your_key_here \
-e AGENTIO_CONFIG=your_config_here \
-e CLOUDFLARE_TUNNEL_TOKEN=eyJhIjoiYWNj... \
-v agentio-data:/data \
--restart unless-stopped \
agentio-gatewayBest for: VPS or server with public IP and domain name.
Requirements:
- Port 443 accessible from the internet
- DNS A record pointing to your server
docker run -d \
--name agentio-gateway \
-e AGENTIO_KEY=your_key_here \
-e AGENTIO_CONFIG=your_config_here \
-e DOMAIN=gateway.example.com \
-p 443:443 \
-v agentio-data:/data \
-v agentio-certs:/certs \
--restart unless-stopped \
agentio-gatewayCaddy automatically obtains and renews Let's Encrypt certificates using TLS-ALPN-01 challenge (no port 80 needed).
Best for: Local development, testing, or behind an external reverse proxy.
docker run -d \
--name agentio-gateway \
-e AGENTIO_KEY=your_key_here \
-e AGENTIO_CONFIG=your_config_here \
-p 7890:7890 \
-v agentio-data:/data \
--restart unless-stopped \
agentio-gateway| Variable | Description |
|---|---|
AGENTIO_KEY |
Encryption key from agentio config export |
AGENTIO_CONFIG |
Encrypted config from agentio config export |
| Variable | Mode | Description |
|---|---|---|
CLOUDFLARE_TUNNEL_TOKEN |
Cloudflare | Tunnel token from Cloudflare dashboard |
DOMAIN |
Caddy | Public domain for TLS certificate |
| Variable | Default | Description |
|---|---|---|
GATEWAY_PORT |
7890 |
Internal gateway port |
ACME_EMAIL |
(none) | Email for Let's Encrypt notifications |
| Path | Description |
|---|---|
/data |
Configuration, database, media files |
/certs |
TLS certificates (Caddy mode only) |
The container includes a health check on the /health endpoint:
docker inspect --format='{{.State.Health.Status}}' agentio-gateway# View logs
docker logs agentio-gateway
# Follow logs
docker logs -f agentio-gatewaydocker pull agentio-gateway:latest
docker stop agentio-gateway
docker rm agentio-gateway
# Re-run with same docker run commandIf you're using WhatsApp and need to pair a new device:
- Ensure the gateway is running and accessible
- Access the pairing endpoint:
GET /whatsapp/pair/{profile} - Scan the QR code with WhatsApp
For remote gateways, you can use teleport to migrate existing WhatsApp sessions:
# On your local machine with an authenticated WhatsApp session
agentio gateway teleport https://your-gateway.example.comVerify your environment variables are set correctly:
docker exec agentio-gateway env | grep AGENTIOCheck cloudflared logs:
docker logs agentio-gateway 2>&1 | grep cloudflaredEnsure:
- Port 443 is accessible from the internet
- DNS is correctly configured
- Domain resolves to your server's IP
Check Caddy logs:
docker logs agentio-gateway 2>&1 | grep caddyCheck if the gateway process is running:
docker exec agentio-gateway ps aux