Skip to content

Install moirad

moirad runs on each host as an ordinary Compose stack inside that host’s own deploy folder, at <DEPLOY_DIR>/moirad/compose.yml. Its state (TLS key, enrolled clients) lives next to it in the same directory.

  • Linux amd64 with Docker Engine.
  • A deploy folder that follows the conventions.
  • Registry logins stored inline in /root/.docker/config.json, with no credsStore or credHelpers. The image has no credential helper binaries, and moira update pulls with whatever the host is logged in to.
  • A trusted network between the host and your machines (a VPN or LAN). moirad holds the Docker socket, which is root on the host.

The image is ghcr.io/greek-stuff/moirad, published as a private package. On the host, log in from the Docker account that runs Compose. When prompted for a password, use a classic GitHub personal access token with read:packages and access to the package.

Terminal window
docker login ghcr.io --username YOUR_GITHUB_USERNAME
ls -l /root/.docker/config.json # verify the path you will mount

Create <DEPLOY_DIR>/moirad/compose.yml. This example uses /srv/deploy as the deploy folder and 192.0.2.10 as the address clients use:

name: moirad
services:
moirad:
image: ghcr.io/greek-stuff/moirad:stable
container_name: moirad
restart: unless-stopped
environment:
DEPLOY_DIR: /srv/deploy
MOIRAD_HOST: edge
MOIRAD_URL: https://192.0.2.10:7443
ports:
- "7443:7443" # keep off public interfaces with a firewall
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /srv/deploy:/srv/deploy # the SAME path inside and outside
- type: bind
source: /root/.docker/config.json
target: /root/.docker/config.json
read_only: true
bind:
create_host_path: false
  • The same-path mount is required. Compose reads env_files inside the container and turns relative bind sources (./data) into absolute paths that the Docker daemon then opens on the host. Both only work if the path is the same on both sides.
  • MOIRAD_URL is what clients connect to and goes into every invite. Its host becomes the certificate’s SAN, so use the address clients will actually dial.
  • MOIRAD_HOST is the name clients use as the target prefix (edge/shop-prod).
  • The :stable tag lets self-update follow releases.

See moirad configuration for every variable.

Terminal window
cd /srv/deploy/moirad
docker compose up -d
docker logs moirad

On first start the daemon creates a self-signed ECDSA certificate in moirad/tls/ and an empty clients.json. It then loads every stack’s Compose model in the background.

Keep :7443 reachable only from trusted networks:

  • On LAN or VPN-only hosts, publishing on all addresses is fine.
  • On hosts with a public interface, drop new connections from public interfaces to published ports (for example in the DOCKER-USER iptables chain) before starting moirad, then check from outside that :7443 doesn’t answer.
  • Binding the port to a VPN address (192.0.2.10:7443:7443) fails after a reboot if the VPN interface comes up after Docker. A firewall rule avoids that ordering problem.

docker login replaces config.json with a new file. A single-file bind mount keeps the old inode, so restart the daemon afterwards:

Terminal window
cd /srv/deploy/moirad && docker compose restart moirad

Install moira on your machine, then enroll it.