Skip to Content
HostWall
Installation

Docker

Run HostWall with Docker or Docker Compose: volumes, ports, the dashboard address, the initial password and the CLI.

The image is ghcr.io/hostwall/hostwall, built for linux/amd64 and linux/arm64. Tags are the release version without the v (0.1.0), the minor version (0.1), and latest (stable releases only, not pre-releases).

The image is based on distroless and runs as a non-root user (UID 65532). There is no shell inside it.

How configuration gets in

Inside the container, HostWall reads:

PathWhatHow to provide it
/etc/hostwall/hostwall.yamlConfig file (HOSTWALL_CONFIG). Optional: without it, add sites in the dashboard.Mount it read-only
/var/lib/hostwallDatabase, certificates, initial admin password (HOSTWALL_DATA)A named volume or a host directory

The dashboard listens on 0.0.0.0:9443 inside the container. The image sets HOSTWALL_DASHBOARD=0.0.0.0:9443, which is used whenever the config file doesn't set server.dashboard. (The usual default, 127.0.0.1, would only be reachable from inside the container.) If your config file sets server.dashboard, it must use 0.0.0.0 too.

So that the dashboard isn't exposed to the internet, publish port 9443 on the host's loopback only (-p 127.0.0.1:9443:9443) and use an SSH tunnel, as in the quickstart.

If you use a config file, consider mounting its directory (./config:/etc/hostwall:ro) rather than the single file. Many editors save a file by replacing it, and a single-file bind mount keeps pointing at the old copy, so HostWall wouldn't see your changes until the container restarts.

docker run

docker run -d --name hostwall \
  --restart unless-stopped \
  -p 80:80 -p 443:443 \
  -p 127.0.0.1:9443:9443 \
  -v hostwall-data:/var/lib/hostwall \
  ghcr.io/hostwall/hostwall:latest

With a config file, add -v "$PWD/config:/etc/hostwall:ro" (a directory that contains hostwall.yaml).

Always mount a volume at /var/lib/hostwall. Without it, your sites, accounts and certificates disappear when the container is removed, and you could hit Let's Encrypt rate limits by requesting new certificates on every start.

docker compose

# compose.yaml
services:
  hostwall:
    image: ghcr.io/hostwall/hostwall:latest
    container_name: hostwall
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
      - "127.0.0.1:9443:9443"   # dashboard: reach it through an SSH tunnel
    volumes:
      - hostwall-data:/var/lib/hostwall
      - ./config:/etc/hostwall:ro    # optional: a directory with hostwall.yaml
    # Uncomment to reach an app that runs on the Docker host itself
    # (then use upstream: http://host.docker.internal:3000).
    # extra_hosts:
    #   - "host.docker.internal:host-gateway"

  # Example app on the same network: use upstream: http://app:3000
  # app:
  #   image: your/app
  #   expose: ["3000"]

volumes:
  hostwall-data:
docker compose up -d
docker compose logs -f hostwall

Initial password and CLI in Docker

On first start, HostWall creates the dashboard user admin with a random password. It is printed in the container log on every start until you change it, and written to /var/lib/hostwall/initial-admin.txt in the volume:

docker logs hostwall
docker logs hostwall 2>&1 | grep "Initial password"

Every CLI command works through docker exec, for example:

docker exec hostwall hostwall logs -n 50
docker exec hostwall hostwall site mode example.com block

Docker notes

  • Upstreams. Inside the container, localhost is the container itself. Use a service name on the same Docker network (http://app:3000) or host.docker.internal as shown above.
  • Using a host directory instead of a named volume? It must be writable by UID 65532: sudo chown -R 65532:65532 ./data.
  • Ports 80 and 443 as a non-root user. This works with normal port publishing (-p) on Docker 20.10 and later. With --network host the container can't bind ports below 1024 as non-root.
  • Client IPs. With normal IPv4 port publishing, HostWall sees the real client IP. In some setups (IPv6 published through Docker's userland proxy, some rootless Docker setups) every request appears to come from a Docker gateway address. See Troubleshooting.
  • Upgrading. Pull the new image and recreate the container: docker compose pull && docker compose up -d. hostwall upgrade is meant for binary installs, not containers.

Edit this page on GitHub

On this page