Self-hosting & operations

Deployment

Run with Docker Compose or as a standalone Node server under PM2, behind nginx with TLS and SSE-friendly settings.

Last updated 1 min readv1.0

#Docker

The repository ships a multi-stage Dockerfile (Node 22 Alpine, non-root user, built-in HEALTHCHECK on /api/health) and a docker-compose.yml that binds to 127.0.0.1:3030 and mounts a named volume at /app/data.

Shell
docker compose up -d --build
docker compose logs -f web
docker compose ps            # STATUS shows (healthy) once /api/health answers

#Standalone with PM2

Shell
npm ci && npm run build
sh deploy/build-standalone.sh            # copies public/ and .next/static next to server.js
pm2 start deploy/ecosystem.config.cjs && pm2 save

deploy/ecosystem.config.cjs runs one fork-mode instance, keeps DATA_DIR outside .next/standalone (which every build wipes), and gives the store five seconds to flush on restart.

#Reverse proxy

Use deploy/nginx.conf as a starting point. The one setting that matters most: disable buffering for /api/stream, or live updates arrive in bursts.

nginx (excerpt)Shell
location = /api/stream {
    proxy_pass http://127.0.0.1:3030;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_buffering off;
    proxy_cache off;
    proxy_read_timeout 1h;
}

#Checklist

  • MODE=live and every contract address from deployments/elysium-99901.json is set; CHAIN_ID=99901.
  • SITE_URL is the public https:// origin and SESSION_SECRET is set (≥ 32 chars).
  • DATA_DIR is on persistent storage and backed up.
  • Exactly one instance is running.
  • TLS is terminated at the proxy; TRUST_PROXY=true only when a proxy is in front.
  • GET /api/health returns ok: true, mode: "live", status: "ok" and market: "ok".
  • The server can reach RPC_URL and api.hyperliquid.xyz over HTTPS.
Something unclear or wrong on this page? Report it.Updated Dec 1, 2026 · v1.0