INSTALLATION

Copy, paste, running in minutes.

Site Gateway ships as a single container. Point it at a data directory, set an admin password, and it handles TLS, routing, and backups from there.

Docker or Docker Compose x86-64 or ARM64 Ports 80 / 443 open ~2 minutes

01 · Docker Compose

The recommended way to run Site Gateway. Drop this into compose.yaml and adjust the two required environment values.

compose.yaml
services:
  site-gateway:
    image: ghcr.io/mfwadejr/site-gateway:latest
    container_name: site-gateway
    restart: unless-stopped   # required — the System tab's "Restart application" button
                               # only works when a restart policy is set on the container
    # Optional but recommended: without a memory/CPU limit, the Dashboard and Administration
    # System tab's live resource panel can only show usage against the whole host, which is
    # rarely meaningful on a shared machine. Setting these gives CPU/Memory a real, container-
    # scoped denominator to measure against instead.
    # mem_limit: 2g
    # cpus: "2"
    # For CPU, pinning specific cores is also supported instead of (or in addition to) a count —
    # the resource panel reads whichever one Docker actually applied:
    # cpuset: "0,1"
    environment:
      ADMIN_USERNAME: admin
      ADMIN_PASSWORD: changeme      # required — set a strong password
      SESSION_SECRET: changeme-too  # required — any random string
      ADMIN_PORT: 8080
      SITE_PORT_MIN: 9000
      SITE_PORT_MAX: 9099
      DATA_DIR: /data
      PUID: 1000                   # Unraid: use 99
      PGID: 1000                   # Unraid: use 100
      # DATA_DIR_LIMIT_GB: 30       # optional — Docker has no native per-container disk quota,
                                    # so this just gives the resource panel's Disk stat a real
                                    # assigned size to measure your /data usage against, instead
                                    # of the size of the whole underlying volume/array.
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"                # HTTP/3 (QUIC) — forward UDP 443 on your router/firewall too
      - "8080:8080"
      - "9000-9099:9000-9099"
      # Streaming Hosts (optional): add one line per TCP/UDP port you
      # forward from the dashboard. Example for a Minecraft server:
      # - "25565:25565"
      # - "25565:25565/udp"
    volumes:
      - /path/to/data:/data

Then bring it up: docker compose up -d. The same file works unmodified in Portainer's Stacks and ZimaOS.

02 · Plain docker run

Prefer a single command over a compose file? This is equivalent to the block above, with the same optional resource limits from the compose example included directly (delete any of the three marked lines below if you don't want them).

terminal
docker run -d \
  --name site-gateway \
  --restart unless-stopped \
  --memory=2g \
  --cpus="2" \
  -e ADMIN_USERNAME=admin \
  -e ADMIN_PASSWORD=changeme \
  -e SESSION_SECRET=changeme-too \
  -e ADMIN_PORT=8080 \
  -e SITE_PORT_MIN=9000 \
  -e SITE_PORT_MAX=9099 \
  -e DATA_DIR=/data \
  -e DATA_DIR_LIMIT_GB=30 \
  -p 80:80 -p 443:443 -p 443:443/udp \
  -p 8080:8080 \
  -p 9000-9099:9000-9099 \
  -v /path/to/data:/data \
  ghcr.io/mfwadejr/site-gateway:latest

--restart unless-stopped is required for the System tab's "Restart application" button — Docker won't restart a container with no restart policy set. The other three lines are optional: --memory and --cpus give the Dashboard and Administration > System tab's live resource panel a real, container-scoped denominator for CPU/Memory instead of the whole host — delete both if you'd rather leave the container unlimited, or swap --cpus="2" for --cpuset-cpus="0,1" to pin specific cores instead of a count. DATA_DIR_LIMIT_GB is the equivalent for Disk: Docker has no native per-container disk quota, so this just tells the resource panel what to measure your /data usage against instead of the size of the whole underlying volume — delete it to fall back to comparing against the whole volume. All three are independent of each other.

03 · Unraid

Add the container from Docker → Add Container using the image ghcr.io/mfwadejr/site-gateway:latest, or search Community Applications once a template is published. Map the same ports and one path as above.

PUID / PGID on Unraid: set PUID=99 and PGID=100 instead of the Linux defaults shown in the compose file, so the container writes to /data as the nobody/users account Unraid expects.

04 · Environment reference

VariableRequiredDefaultNotes
ADMIN_USERNAMEYes—Initial administrator account, created on first boot.
ADMIN_PASSWORDYes—Use a strong, unique password — this account can manage every route and Access List.
SESSION_SECRETYes—Any random string. Rotating it signs everyone out.
ADMIN_PORTNo8080Dashboard port, mapped separately from 80/443.
SITE_PORT_MIN / SITE_PORT_MAXNo9000–9099Direct-LAN port range Hosted Sites can bind to.
DATA_DIRNo/dataWhere the SQLite database, certificates, hosted files, and backups live. Should map to a persistent volume.
PUID / PGIDNo1000 / 1000User/group the container writes files as. Use 99/100 on Unraid.
DATA_DIR_LIMIT_GBNo— (unset)Display-only allowance for the live resource panel's Disk stat — Docker has no native per-container disk quota, so this just gives it a real number to measure your /data usage against instead of the whole underlying volume.

05 · Streaming Hosts (optional)

Raw TCP/UDP forwarding (game servers, SSH, anything that isn't HTTP) needs its own port published up front — Docker can't add ports to a running container. Add one line per port to the ports: list before creating the Streaming Host in the dashboard, then recreate the container:

  • "25565:25565" and "25565:25565/udp" for a Minecraft server, for example.
  • Match the container-side port to whatever you'll enter as the Streaming Host's target port.

06 · First login

Once the container is healthy, open http://<your-host>:8080 and sign in with the administrator credentials you set above. From there:

  • Create your first route — Hosted, Proxy, Redirect, or Streaming — from the dashboard.
  • Point a domain's DNS at this host, and Site Gateway/Caddy handle certificate issuance automatically.
  • Set up a scheduled backup under Backup & Restore before you rely on this for anything real.
Need a hand? Open an issue on GitHub with your compose file (redact secrets) and container logs.