Self-hosting
Run your own server with Docker, behind TLS, with persistence.
Docker Compose
The project ships a Compose file that runs the Go server and nginx (which serves the web app and proxies /api, /ws, /install.sh and /download on one origin). Sessions are stored in the zero-data volume.
PUBLIC_ORIGIN=https://files.example.com docker compose up --build -dTLS
Browsers only expose the encryption API on secure origins, so serve Zero Portal over HTTPS (or use localhost). Terminate TLS in a reverse proxy or load balancer in front of port 8080 and enable HSTS. Set TRUST_PROXY=true so rate limits see the real client address, and PUBLIC_URL=https://files.example.com so install scripts hand out the right address.
Configuration
| Variable | Default | Meaning |
|---|---|---|
| ADDR | :8080 | Listen address of the Go server. |
| ALLOWED_ORIGIN | * | Allowed web origin(s), comma separated. Set this in production. |
| PUBLIC_URL | (from the request) | Address agents are told to use, e.g. https://files.example.com. |
| SESSION_RETENTION | 168h | How long a session with no device online is kept (7 days). The same for everyone. |
| DATA_DIR | data | Where sessions are saved. off = memory only. Hashes only, file mode 0600. |
| AGENT_DIR | dist/agent | Folder with the agent binaries served at /download. |
| MAX_PEERS / MAX_FILE_SIZE | 8 / 10737418240 | Defaults for new sessions. |
| MAX_PORTALS | 10000 | Cap on stored sessions (503 when full). |
| RATE_CREATE_PER_MIN, RATE_LOOKUP_PER_MIN, RATE_WS_PER_MIN | 10 / 60 / 60 | Per-IP limits; 0 disables a limit. |
| TRUST_PROXY | false | Read the client IP from X-Real-IP / X-Forwarded-For. Only behind a proxy that sets them. |
Operating it
- Backups: back up the data volume if sessions must outlive the host. It contains no tokens or passwords in clear text.
- Upgrades: rebuild and restart. Sessions are restored and members reconnect on their own.
- Health:
GET /health, andzero-server healthcheckinside the container. - Cross-compile agents yourself:
make distwrites binaries and checksums for every platform.