Search docsComing soon

Self-host installation

This page provides the base Compose file used in the self-host deployment guide.

Docker Compose

services:
  db:
    image: postgres:16
    environment:
      POSTGRES_DB: nanami
      POSTGRES_USER: nanami
      POSTGRES_PASSWORD: nanami
    ports:
      - "5432:5432"
    volumes:
      - nanami-db:/var/lib/postgresql/data

  relay-daemon:
    build:
      context: ..
      dockerfile: ../apps/relay/Dockerfile
    profiles:
      - relay
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    sysctls:
      - net.ipv4.ip_forward=1
      - net.ipv6.conf.all.forwarding=1
    extra_hosts:
      - "host.docker.internal:host-gateway"
    environment:
      CONTROL_PLANE_URL: ${CONTROL_PLANE_URL:-http://host.docker.internal:8080}
      RELAY_DAEMON_JOIN_KEY: ${RELAY_DAEMON_JOIN_KEY:-}
      RELAY_MANAGER_URL: ${RELAY_MANAGER_URL:-http://host.docker.internal:8081}
      NODE_JOIN_KEY: ${NODE_JOIN_KEY:-node-secret-key}
      NODE_ENDPOINT: ${NODE_ENDPOINT:-}
      STATE_DIR: /var/lib/nanami/relay
      HEALTH_ADDR: :8082
    volumes:
      - relay-state:/var/lib/nanami/relay
      - /lib/modules:/lib/modules:ro
    ports:
      - "8082:8082"
      - "51820:51820/udp"

volumes:
  nanami-db:
  relay-state:

Next steps

  • Start Postgres and the relay-daemon profile.
  • Continue with the deployment guide for control-plane, relay-manager, and WebUI.