Deploy and upgrade safely

Docker, HTTPS, persistence, backups and migrations for a single-node gateway.

v0.3.0 · Updated November 2, 2026
On this page

Docker from source

Terminal
docker compose up --build -d
# A different host port:
CONFLUX_PORT=3004 docker compose up --build -d

The image uses Node 24, a non-root user, a read-only filesystem, dropped capabilities and a writable named volume at /app/data. It binds loopback by default. A published registry image is not required or claimed.

Put HTTPS in front

Set CONFLUX_PUBLIC_ORIGIN to your HTTPS origin. Keep the backend on loopback behind a trusted reverse proxy. Only set CONFLUX_TRUST_PROXY=true when the proxy overwrites forwarded IP headers.

Nginx · inside an HTTPS server
location / {
    proxy_pass http://127.0.0.1:3000;
    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto https;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_buffering off;
    proxy_read_timeout 300s;
}

Disable SSE buffering and allow enough time for streaming requests. TLS certificate setup belongs to your reverse proxy.

Keep the database and encryption key together

Terminal
npm run backup -- /private/new-backup-directory

This creates a consistent SQLite backup with encryption material and restricted permissions. Treat the whole directory as sensitive. For Docker, use the same consistent backup procedure or stop the container before copying the database and key. Do not copy a database while writes are in progress.

Upgrade with a backup

Back up first, then build and start the new version using the existing volume. Migrations are transactional and locked. Schema 6 requires a compatible release; rolling back needs the corresponding pre-upgrade backup. The current code rejects newer unknown schemas instead of guessing.

SQLite single-node deployment is implemented. PostgreSQL through DATABASE_URL remains pending. Health and readiness checks do not establish upstream generation access.