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.
Requirements
Section titled “Requirements”- Linux amd64 with Docker Engine.
- A deploy folder that follows the conventions.
- Registry logins stored inline in
/root/.docker/config.json, with nocredsStoreorcredHelpers. The image has no credential helper binaries, andmoira updatepulls with whatever the host is logged in to. - A trusted network between the host and your machines (a VPN or LAN).
moiradholds the Docker socket, which is root on the host.
Log in to the registry
Section titled “Log in to the registry”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.
docker login ghcr.io --username YOUR_GITHUB_USERNAMEls -l /root/.docker/config.json # verify the path you will mountCompose file
Section titled “Compose file”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: moiradservices: 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_URLis 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_HOSTis the name clients use as the target prefix (edge/shop-prod).- The
:stabletag lets self-update follow releases.
See moirad configuration for every variable.
Start it
Section titled “Start it”cd /srv/deploy/moiraddocker compose up -ddocker logs moiradOn 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.
Restrict the port
Section titled “Restrict the port”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-USERiptables chain) before startingmoirad, then check from outside that:7443doesn’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.
After rotating registry credentials
Section titled “After rotating registry credentials”docker login replaces config.json with a new file. A single-file bind mount keeps the old
inode, so restart the daemon afterwards:
cd /srv/deploy/moirad && docker compose restart moiradInstall moira on your machine, then enroll it.