Quickstart

Run Lahijan with one docker compose command. Save two files, start it, and sign in.

Lahijan starts with a single command. You save two files, run docker compose up -d, and open the dashboard. There is no source code to get, nothing to build and no database to set up.

Note

You need Docker with Compose 2.20 or newer (Docker Desktop includes it) and about 4 GB of free memory.

1. Save the two files

Create an empty folder and save these two files in it, named exactly compose.yaml and .env:

# Lahijan: the whole platform in one file.##   docker compose up -d## Settings live in the .env file next to this one. With no domain set, Lahijan# runs on http://localhost:8080 for a trial; set LAHIJAN_DOMAIN to serve it on# your own domain with automatic HTTPS. Passwords and keys are generated on the# first start and kept in the `secrets` volume. name: lahijan services:  # Generates the passwords and keys once. Everything else waits for it.  secrets:    image: ghcr.io/avestura/lahijan-init:${LAHIJAN_VERSION:-latest}    restart: "no"    volumes:      - secrets:/secrets   postgres:    image: ghcr.io/avestura/lahijan-postgres:${LAHIJAN_VERSION:-latest}    restart: unless-stopped    depends_on:      secrets:        condition: service_completed_successfully    env_file: .env    environment:      POSTGRES_USER: postgres      POSTGRES_DB: postgres      LAHIJAN_DB_NAME: lahijan      LAHIJAN_DB_USER: lahijan      PDNS_DB_NAME: pdns      PDNS_DB_USER: pdns      SEAWEED_DB_NAME: seaweed      SEAWEED_DB_USER: seaweed    volumes:      - secrets:/secrets:ro      - postgres_data:/var/lib/postgresql/data    healthcheck:      test: ["CMD-SHELL", "pg_isready -U postgres"]      interval: 10s      timeout: 5s      retries: 10      start_period: 30s    shm_size: 256m   # Creates the database tables. Runs on every start and does nothing when they  # are already up to date.  migrate:    image: ghcr.io/avestura/lahijan-migrate:${LAHIJAN_VERSION:-latest}    restart: "no"    depends_on:      postgres:        condition: service_healthy    volumes:      - secrets:/secrets:ro   # DNS: hosts the zones your users create.  powerdns:    image: ghcr.io/avestura/lahijan-powerdns:${LAHIJAN_VERSION:-latest}    restart: unless-stopped    depends_on:      postgres:        condition: service_healthy    env_file: .env    environment:      TEMPLATE_FILES: lahijan      PDNS_DB_HOST: postgres      PDNS_DB_PORT: "5432"      PDNS_DB_NAME: pdns      PDNS_DB_USER: pdns      PDNS_WEBSERVER_ALLOW_FROM: 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16      PDNS_DEFAULT_SOA_CONTENT: ${LAHIJAN_DOMAIN:+ns1.}${LAHIJAN_DOMAIN:-ns1.example.com}. hostmaster.@ 0 10800 3600 604800 3600    ports:      - "${LAHIJAN_DNS_PORT:-5353}:53/udp"      - "${LAHIJAN_DNS_PORT:-5353}:53/tcp"    volumes:      - secrets:/secrets:ro    healthcheck:      test: ["CMD", "pdns_control", "rping"]      interval: 15s      timeout: 5s      retries: 10      start_period: 30s   # Object storage (S3): master, volume, filer and the S3 gateway.  seaweed-master:    image: ghcr.io/avestura/lahijan-seaweedfs:${LAHIJAN_VERSION:-latest}    restart: unless-stopped    command:      - master      - -ip=seaweed-master      - -ip.bind=0.0.0.0      - -port=9333      - -defaultReplication=000      - -volumeSizeLimitMB=${SEAWEEDFS_VOLUME_SIZE_LIMIT_MB:-5000}      - -volumePreallocate=false    volumes:      - seaweedfs_data:/data    healthcheck:      test: ["CMD-SHELL", "wget -q -O /dev/null --tries=1 --timeout=3 http://127.0.0.1:9333/ || exit 1"]      interval: 15s      timeout: 5s      retries: 10      start_period: 30s   seaweed-volume:    image: ghcr.io/avestura/lahijan-seaweedfs:${LAHIJAN_VERSION:-latest}    restart: unless-stopped    depends_on:      seaweed-master:        condition: service_healthy    command:      - volume      - -ip=seaweed-volume      - -ip.bind=0.0.0.0      - -port=8080      - -mserver=seaweed-master:9333      - -publicUrl=http://seaweed-volume:8080    volumes:      - seaweedfs_data:/data    healthcheck:      test: ["CMD-SHELL", "wget -q -O /dev/null --tries=1 --timeout=3 http://127.0.0.1:8080/status || exit 1"]      interval: 15s      timeout: 5s      retries: 10      start_period: 30s   seaweed-filer:    image: ghcr.io/avestura/lahijan-seaweedfs:${LAHIJAN_VERSION:-latest}    restart: unless-stopped    depends_on:      seaweed-master:        condition: service_healthy      seaweed-volume:        condition: service_healthy      postgres:        condition: service_healthy    command:      - filer      - -ip=seaweed-filer      - -ip.bind=0.0.0.0      - -port=8888      - -master=seaweed-master:9333      - -saveToFilerLimit=65536    env_file: .env    environment:      WEED_POSTGRES2_HOSTNAME: postgres      WEED_POSTGRES2_DATABASE: seaweed      WEED_POSTGRES2_USERNAME: seaweed    volumes:      - secrets:/secrets:ro    healthcheck:      test: ["CMD-SHELL", "wget -q -O /dev/null --tries=1 --timeout=3 http://127.0.0.1:8888/ || exit 1"]      interval: 15s      timeout: 5s      retries: 10      start_period: 30s   # Writes the storage admin identity before the S3 gateway starts, so S3 is  # never open.  seaweed-iam-init:    image: ghcr.io/avestura/lahijan-init:${LAHIJAN_VERSION:-latest}    restart: "no"    depends_on:      seaweed-filer:        condition: service_healthy    env_file: .env    command: ["seed-iam"]    volumes:      - secrets:/secrets:ro   seaweed-s3:    image: ghcr.io/avestura/lahijan-seaweedfs:${LAHIJAN_VERSION:-latest}    restart: unless-stopped    depends_on:      seaweed-filer:        condition: service_healthy      seaweed-iam-init:        condition: service_completed_successfully    command:      - s3      - -ip.bind=0.0.0.0      - -port=8333      - -filer=seaweed-filer:8888    ports:      - "${LAHIJAN_S3_PORT:-8333}:8333"    healthcheck:      test: ["CMD-SHELL", "wget -q -O /dev/null --tries=1 --timeout=3 http://127.0.0.1:8333/status || exit 1"]      interval: 15s      timeout: 5s      retries: 10      start_period: 30s   # Compute (containers and virtual machines). Off by default: it needs a Linux  # host with Incus support. Turn it on with COMPOSE_PROFILES=compute and  # LAHIJAN_COMPUTE=true in .env.  incus:    image: ghcr.io/cmspam/incus-docker:${INCUS_IMAGE_TAG:-lts}    profiles: [compute]    restart: unless-stopped    privileged: true    network_mode: host    pid: host    cgroup: host    environment:      SETIPTABLES: "true"    volumes:      - /dev:/dev      - /var/lib/incus:/var/lib/incus      - /lib/modules:/lib/modules:ro    healthcheck:      test: ["CMD-SHELL", "incus list >/dev/null 2>&1 || test -S /var/lib/incus/unix.socket"]      interval: 15s      timeout: 5s      retries: 12      start_period: 60s   lahijan:    image: ghcr.io/avestura/lahijan:${LAHIJAN_VERSION:-latest}    restart: unless-stopped    depends_on:      postgres:        condition: service_healthy      migrate:        condition: service_completed_successfully      powerdns:        condition: service_healthy      seaweed-s3:        condition: service_healthy      incus:        condition: service_healthy        required: false    # Any Lahijan setting can be added to .env (LAHIJAN_SMTP_HOST=..., and so on).    env_file: .env    environment:      LAHIJAN_ENVIRONMENT: prd      LAHIJAN_HTTP_SERVER_HOST: 0.0.0.0      LAHIJAN_HTTP_SERVER_PORT: "8080"      LAHIJAN_HTTP_SERVER_HEALTHCHECK_ENABLED: "true"      LAHIJAN_AUTH_SESSION_SECURE: ${LAHIJAN_DOMAIN:+true}      LAHIJAN_DATABASE_HOST: postgres      LAHIJAN_DATABASE_PORT: "5432"      LAHIJAN_DATABASE_NAME: lahijan      LAHIJAN_DATABASE_USER: lahijan      LAHIJAN_DATABASE_SSLMODE: disable      LAHIJAN_AUTH_PASSWORD_MINLENGTH: "12"      LAHIJAN_SMTP_ENABLED: ${LAHIJAN_SMTP_ENABLED:-false}      LAHIJAN_SMTP_APPBASEURL: ${LAHIJAN_DOMAIN:+https://}${LAHIJAN_DOMAIN:-http://localhost:${LAHIJAN_HTTP_PORT:-8080}}      LAHIJAN_JOBS_ENABLED: "true"      LAHIJAN_JOBS_ADMINUI_ENABLED: "true"      LAHIJAN_WASM_ENABLED: "true"      LAHIJAN_PROVIDERS_INCUS_ENABLED: ${LAHIJAN_COMPUTE:-false}      LAHIJAN_PROVIDERS_INCUS_SOCKETPATH: /var/lib/incus/unix.socket      LAHIJAN_PROVIDERS_POWERDNS_ENABLED: "true"      LAHIJAN_PROVIDERS_POWERDNS_BASEURL: http://powerdns:8081      LAHIJAN_PROVIDERS_POWERDNS_DEFAULTNAMESERVERS: ${LAHIJAN_DOMAIN:+ns1.}${LAHIJAN_DOMAIN:-ns1.example.com}.      LAHIJAN_PROVIDERS_SEAWEEDFS_ENABLED: "true"      LAHIJAN_PROVIDERS_SEAWEEDFS_S3ENDPOINT: http://seaweed-s3:8333      LAHIJAN_PROVIDERS_SEAWEEDFS_FILERURL: http://seaweed-filer:8888      LAHIJAN_PROVIDERS_SEAWEEDFS_PUBLICENDPOINT: ${LAHIJAN_DOMAIN:+https://s3.}${LAHIJAN_DOMAIN:-http://localhost:${LAHIJAN_S3_PORT:-8333}}      LAHIJAN_PROVIDERS_SEAWEEDFS_CORSALLOWEDORIGINS: ${LAHIJAN_DOMAIN:+https://}${LAHIJAN_DOMAIN:-http://localhost:${LAHIJAN_HTTP_PORT:-8080}}      LAHIJAN_AUTH_MFA_WEBAUTHN_RPID: ${LAHIJAN_DOMAIN:-localhost}      LAHIJAN_AUTH_MFA_WEBAUTHN_RPORIGINS: ${LAHIJAN_DOMAIN:+https://}${LAHIJAN_DOMAIN:-http://localhost:${LAHIJAN_HTTP_PORT:-8080}}      LAHIJAN_BOOTSTRAP_ENABLED: "true"      LAHIJAN_BOOTSTRAP_ADMINEMAIL: ${LAHIJAN_BOOTSTRAP_ADMIN_EMAIL:-admin@lahijan.local}      LAHIJAN_BOOTSTRAP_ADMINPASSWORD: ${LAHIJAN_BOOTSTRAP_ADMIN_PASSWORD:-}    volumes:      - secrets:/secrets:ro      - lahijan_plugins:/var/lib/lahijan/plugins      - /var/lib/incus:/var/lib/incus:ro    healthcheck:      test: ["CMD-SHELL", "wget -q -O /dev/null --tries=1 --timeout=3 http://127.0.0.1:8080/healthcheck/liveness || exit 1"]      interval: 15s      timeout: 5s      retries: 10      start_period: 60s   # The dashboard and the public entrance (HTTP, or HTTPS with a domain).  web:    image: ghcr.io/avestura/lahijan-web:${LAHIJAN_VERSION:-latest}    restart: unless-stopped    depends_on:      lahijan:        condition: service_healthy    environment:      LAHIJAN_SITE_ADDRESS: ${LAHIJAN_DOMAIN:-:80}      LAHIJAN_S3_SITE_ADDRESS: ${LAHIJAN_DOMAIN:+s3.}${LAHIJAN_DOMAIN:-http://s3.localhost:8081}    ports:      - "${LAHIJAN_HTTP_PORT:-8080}:80"      - "${LAHIJAN_HTTPS_PORT:-8443}:443"      - "${LAHIJAN_HTTPS_PORT:-8443}:443/udp"    volumes:      - caddy_data:/data      - caddy_config:/config    healthcheck:      test: ["CMD-SHELL", "wget -q -O /dev/null --tries=1 --timeout=3 http://127.0.0.1:2019/config/ || exit 1"]      interval: 15s      timeout: 5s      retries: 6      start_period: 15s volumes:  secrets:  postgres_data:  seaweedfs_data:  lahijan_plugins:  caddy_data:  caddy_config:

You do not need to read the compose file to use it. Prefer to download the files?

sh
curl -fsSLo compose.yaml https://raw.githubusercontent.com/avestura/lahijan/main/deployments/install/compose.yamlcurl -fsSLo .env https://raw.githubusercontent.com/avestura/lahijan/main/deployments/install/.env.example

2. Start Lahijan

sh
docker compose up -d

The first start downloads the images and takes a minute or two. Passwords and keys are generated for you.

3. Sign in

Open http://localhost:8080 and sign in with the email address and password from your .env file. That is your administrator account. Change the password in Settings after your first sign-in.

That is all. Continue with First steps to create a DNS zone and a storage bucket.


Everything below is optional. Read it when you need it.

What is running

docker compose ps shows the parts. They all start together, and compose.yaml is the only thing you have to keep:

Part What it does
lahijan The Lahijan server: the API and the background jobs.
web The dashboard, and the front door (plain HTTP, or HTTPS once you add a domain).
postgres The database, shared by Lahijan, DNS and object storage.
powerdns DNS: hosts the zones your users create.
seaweed-* Object storage (S3): buckets and files.
secrets, migrate, seaweed-iam-init One-time jobs: generate the passwords, create the tables, set up storage access. They exit when done.

The DNS and S3 ports are published on your machine as 5353 and 8333, so that nothing clashes with services you already run.

Put it on your own domain

To serve Lahijan at https://cloud.example.com with a free, automatic certificate:

  1. Point two DNS records at your server's public address: cloud.example.com (the dashboard) and s3.cloud.example.com (object storage).

  2. Open ports 80 and 443 (TCP) in your firewall. To host DNS zones for your users, open port 53 (TCP and UDP) too.

  3. Uncomment these lines in .env, using your own domain:

    .envini
    LAHIJAN_DOMAIN=cloud.example.comLAHIJAN_HTTP_PORT=80LAHIJAN_HTTPS_PORT=443LAHIJAN_DNS_PORT=53
  4. Run docker compose up -d again.

Lahijan now answers on https://cloud.example.com, and the S3 endpoint is https://s3.cloud.example.com. The domain also sets the sign-in cookies, passkeys and the DNS name servers (ns1.cloud.example.com) that new zones point at. If the name servers should live on separate records, see TLS and domains. On Ubuntu, port 53 may already be taken by the system's own resolver; the installation guide shows how to free it.

Warning

Anyone who can reach your server can create an account by default. On a private installation, turn registration off before you open it to the internet: add LAHIJAN_AUTH_SIGNUP_ENABLED=false to .env, or use Administration > Settings after you sign in. See Turn registration off.

Turn on compute

Containers and virtual machines need a Linux host with Incus support, so compute is off by default. On such a host, add two lines to .env and run docker compose up -d:

.envini
COMPOSE_PROFILES=computeLAHIJAN_COMPUTE=true

Docker Desktop on Windows and macOS cannot run it. See Initialize Incus for the first-start setup, and Compute overview.

Send email

Verification and password-reset emails need a mail server. Add its details to .env:

.envini
LAHIJAN_SMTP_ENABLED=trueLAHIJAN_SMTP_HOST=smtp.example.comLAHIJAN_SMTP_PORT=587LAHIJAN_SMTP_USER=lahijan@example.comLAHIJAN_SMTP_PASSWORD=your-smtp-passwordLAHIJAN_SMTP_FROM=Lahijan <lahijan@example.com>

Any other Lahijan setting can go in .env the same way. Each one has an environment variable name; see Configuration.

Everyday commands

Run these in the folder with your compose.yaml:

sh
docker compose logs -f lahijan   # watch the server's logdocker compose pull              # fetch newer imagesdocker compose up -d             # apply them (your data stays)docker compose stop              # stop everything, keeping the datadocker compose down              # remove the containers, keeping the datadocker compose down -v           # remove everything, including all data and the generated secrets

By default Lahijan uses the latest images. To stay on one version, add LAHIJAN_VERSION=sha-1a2b3c4 (a tag from the project's image registry) to .env.

Caution

The generated passwords and keys live in the lahijan_secrets Docker volume. Back them up with the rest of your data: without them a restored database cannot be opened. docker run --rm -v lahijan_secrets:/s alpine cat /s/secrets.env > secrets-backup.env saves a copy. Keep it somewhere safe; it contains secrets.

Need more control?

This install is the same Lahijan as the full production stack, with the settings chosen for you. The installation guide covers the longer route for operators who want to manage every file themselves, including monitoring (Grafana, Prometheus, Jaeger and Loki), recursive DNS and custom proxy settings. To change Lahijan itself, see Run from source.

Next steps

Edit this page on GitHub