Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Docker Deployment

Run with pre-built image

docker run -d -p 3000:3000 \
  -e PORTAL__AUTH__AUTH_TOKEN=your-secret-token \
  -e PORTAL__NOSTR__PRIVATE_KEY=your-nostr-private-key-hex \
  getportal/sdk-daemon:0.3.0

Tip: pin a specific version in production (e.g. 0.3.0) rather than :latest to avoid unexpected updates. The image is multi-arch (amd64 + arm64) — Docker pulls the right variant automatically. See Versioning & Compatibility.

Check: curl http://localhost:3000/health, curl http://localhost:3000/version. WebSocket API: ws://localhost:3000/ws (auth required).

Docker Compose

docker-compose.yml:

services:
  portal:
    image: getportal/sdk-daemon:0.3.0
    ports: ["3000:3000"]
    environment:
      - PORTAL__AUTH__AUTH_TOKEN=${PORTAL__AUTH__AUTH_TOKEN}
      - PORTAL__NOSTR__PRIVATE_KEY=${PORTAL__NOSTR__PRIVATE_KEY}
      - PORTAL__WALLET__LN_BACKEND=${PORTAL__WALLET__LN_BACKEND:-none}
      - PORTAL__WALLET__NWC__URL=${PORTAL__WALLET__NWC__URL:-}
      - PORTAL__NOSTR__RELAYS=${PORTAL__NOSTR__RELAYS:-}
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
      interval: 30s
      timeout: 10s
      retries: 3

.env: set PORTAL__AUTH__AUTH_TOKEN, PORTAL__NOSTR__PRIVATE_KEY; optionally PORTAL__WALLET__LN_BACKEND=nwc, PORTAL__WALLET__NWC__URL, PORTAL__NOSTR__RELAYS. Then docker compose up -d.

Env vars

VariableDescription
PORTAL__AUTH__AUTH_TOKENAPI auth token (required).
PORTAL__NOSTR__PRIVATE_KEYNostr private key hex (required).
PORTAL__WALLET__LN_BACKENDnone, nwc, or breez.
PORTAL__WALLET__NWC__URLNWC URL when ln_backend=nwc.
PORTAL__WALLET__BREEZ__API_KEYBreez API key when ln_backend=breez.
PORTAL__WALLET__BREEZ__MNEMONICBreez mnemonic when ln_backend=breez.
PORTAL__NOSTR__RELAYSComma-separated relay URLs.
PORTAL__NOSTR__SUBKEY_PROOFProof for Nostr subkey delegation (optional).

Full list: Environment variables.

Build image from repo

git clone https://github.com/PortalTechnologiesInc/lib.git
cd lib
docker build -t portal-rest:latest .
docker run -d -p 3000:3000 -e PORTAL__AUTH__AUTH_TOKEN=... -e PORTAL__NOSTR__PRIVATE_KEY=... portal-rest:latest

Or with Nix: nix build .#rest-docker then docker load < result.

Use HTTPS and a reverse proxy in production; don’t commit secrets.