Docker
Run Guard from its container image, bound to localhost, with its state on a volume.
Use this route when your bot already runs in containers. For choosing a machine, start with the setup journey.
Mainnet on Linux
Section titled “Mainnet on Linux”On a native Linux host with systemd 250 or newer, Python 3.11 or newer and a local Docker daemon:
curl -fsSL https://zunderlabs.com/i | sh -s -- --container --network mainnetInstallation for this channel is unavailable until its signed publication is verified. Prepare your rules in the setup wizard.
The setup command can also carry your public account and rules. It verifies the release and immutable image, asks for account confirmation, equity cap and the API wallet key privately, and prepares the persistent state. The host encrypts the credential with systemd-creds and supplies it to Guard over standard input on every start. Systemd owns restart and cleanup; Docker’s detached restart policy is disabled for this route.
Follow the local prompts: START with the full account, an attributable note for a new mainnet journal, then ACTIVATE to commit the stated start and boot behavior. Declining leaves the service stopped and boot activation inhibited; rerun the verified installer to continue. Apply your licence or fee approval before connecting the bot. An existing installation keeps its volume, configuration, pairings and journals. Never use init --force, create a replacement volume or delete a journal to resolve an upgrade or halt.
Check /healthz and /guard/status on the host before connecting your bot. The published port remains 127.0.0.1:8547; the container listens internally on 0.0.0.0:8547 for that mapping.
This supervised mainnet route needs native Linux systemd and a local, root-owned Docker daemon. Docker Desktop and remote Docker contexts do not provide that host credential path. On a Mac or Windows computer, use the native macOS or Windows service, or run the container on a Linux server.
For upgrades, stop the bot and host service and rerun the verified installer with the same account and volume. Review its explicit activation prompts; it starts only after those confirmations. For removal, stop and disable the supervisor; preserve the volume and journals unless you separately decide to delete them.
Paper or testnet rehearsal
Section titled “Paper or testnet rehearsal”# 1. Guided setup: keep or edit your rules, the account, the mode,# and for testnet the API wallet key, with hidden input.docker run -it --rm --log-driver=none -v zunder-guard:/data \ ghcr.io/zunderlabs/zunder-guard:v1.0.2 init --interactive \ --rules zr1_eyJ2IjoxLCJtYXhMZXZlcmFnZSI6NSwibWF4TG9zc0F0U3RvcFBjdCI6Miwic3RvcFBvbGljeSI6ImF0dGFjaCIsImRlZmF1bHRTdG9wRGlzdGFuY2VQY3QiOjIsIm1pbkxpcURpc3RhbmNlUGN0IjoxMCwibWF4UG9zaXRpb25QY3QiOjIwMCwibWF4T3BlblJpc2tQY3QiOjYsImRhaWx5TG9zc1N0b3BQY3QiOjYsImRyYXdkb3duSGFsdFBjdCI6MjUsIm1hcmtldHMiOlsiKiJdfQ
# 2. Optional: another client key, for a second bot (the setup already printed one).docker run -it --rm --log-driver=none -v zunder-guard:/data ghcr.io/zunderlabs/zunder-guard:v1.0.2 pair
# 3. Run it in paper mode, reachable from this machine only.docker run -d --name zunder-guard --init --restart unless-stopped \ -v zunder-guard:/data -e ZUNDER_GUARD_LISTEN=0.0.0.0:8547 \ -p 127.0.0.1:8547:8547 ghcr.io/zunderlabs/zunder-guard:v1.0.2Installation for this channel is unavailable until its signed publication is verified. Prepare your rules in the setup wizard.
filled in from your settings ·
If you answered the mode question with testnet, step 3 must say so. Guard refuses to start a testnet config without the network on its command line or in ZUNDER_GUARD_NETWORK, rather than quietly running paper:
docker run -d --name zunder-guard --init --restart unless-stopped \ -v zunder-guard:/data -e ZUNDER_GUARD_LISTEN=0.0.0.0:8547 \ -e ZUNDER_GUARD_NETWORK=testnet \ -p 127.0.0.1:8547:8547 ghcr.io/zunderlabs/zunder-guard:v1.0.2Installation for this channel is unavailable until its signed publication is verified. Prepare your rules in the setup wizard.
The setup asks for the testnet key itself and stores it in the volume as api-wallet-key (mode 0600, readable only by the container’s user); run reads it from there. The deploy wizard writes these lines with your rules. For mainnet, use the supervised Linux route above: a detached container alone cannot recover its stdin credential after a restart.
Things to get right
Section titled “Things to get right”-p 127.0.0.1:8547:8547, not-p 8547:8547. The short form publishes the port on every interface of the host, and Docker writes its own firewall rules pastufw. Inside the container Guard listens on127.0.0.1unlessZUNDER_GUARD_LISTENsays otherwise, so a careless-palone reaches nothing.- The volume holds the journal. Deleting it deletes the risk state, and a new journal starts with a new peak and no halt. Back it up; do not share it between two containers. The journal is locked against a second process.
- Pin the image by digest once you have verified it:
installation channel pending verification. A tag can move; a digest cannot. - A bot in another container reaches Guard on a shared Docker network (for example
http://guard:8547in the Compose file below), not through the published port.
Docker Compose for paper or testnet
Section titled “Docker Compose for paper or testnet”The release ships compose.yaml: read-only root, all capabilities dropped, the port on 127.0.0.1 only, the state on a volume.
docker compose run --rm guard init --interactive --rules zr1_… # guided setup; prints the bot's client keydocker compose run --rm guard pair # optional: a client key for a second botdocker compose up -dA bot in the same project reaches Guard at http://guard:8547:
services: guard: image: ghcr.io/zunderlabs/zunder-guard:v1.0.2 restart: unless-stopped init: true read_only: true cap_drop: [ALL] environment: ZUNDER_GUARD_LISTEN: "0.0.0.0:8547" # ZUNDER_GUARD_NETWORK: "testnet" # required if init set Guard up for testnet ports: ["127.0.0.1:8547:8547"] volumes: ["guard-data:/data"] bot: image: your-bot environment: HYPERLIQUID_API_URL: http://guard:8547volumes: guard-data: {}Installation for this channel is unavailable until its signed publication is verified. Prepare your rules in the setup wizard.
HYPERLIQUID_API_URL is an example name; use whatever setting your bot reads (Integrations). For testnet, the shipped compose.yaml also shows a Compose secret: a file owned by uid 65532, mode 0600. That file-based option is not the mainnet credential route.
This page as plain Markdown, for people and LLMs: /docs/deploy/docker.md