Compose Farm
A minimal CLI tool to run Docker Compose commands across multiple hosts via SSH.
Note
Agentless multi-host Docker Compose. CLI-first with a web UI. Your files stay as plain foldersโversion-controllable, no lock-in. Run cf apply and reality matches your config.
Why Compose Farm?
- Your files, your control โ Plain folders + YAML, not locked in Portainer. Version control everything.
- Agentless โ Just SSH, no agents to deploy (unlike Dockge).
- Zero changes required โ Existing compose files work as-is.
- Grows with you โ Start single-host, scale to multi-host seamlessly.
- Declarative โ Change config, run
cf apply, reality matches.
Quick Demo
CLI:
Web UI:
Table of Contents
-โฆ
Compose Farm
A minimal CLI tool to run Docker Compose commands across multiple hosts via SSH.
Note
Agentless multi-host Docker Compose. CLI-first with a web UI. Your files stay as plain foldersโversion-controllable, no lock-in. Run cf apply and reality matches your config.
Why Compose Farm?
- Your files, your control โ Plain folders + YAML, not locked in Portainer. Version control everything.
- Agentless โ Just SSH, no agents to deploy (unlike Dockge).
- Zero changes required โ Existing compose files work as-is.
- Grows with you โ Start single-host, scale to multi-host seamlessly.
- Declarative โ Change config, run
cf apply, reality matches.
Quick Demo
CLI:
Web UI:
Table of Contents
Why Compose Farm?
I used to run 100+ Docker Compose stacks on a single machine that kept running out of memory. I needed a way to distribute stacks across multiple machines without the complexity of:
- Kubernetes: Overkill for my use case. I donโt need pods, services, ingress controllers, or YAML manifests 10x the size of my compose files.
- Docker Swarm: Effectively in maintenance modeโno longer being invested in by Docker.
Both require changes to your compose files. Compose Farm requires zero changesโyour existing docker-compose.yml files work as-is.
I also wanted a declarative setupโone config file that defines where everything runs. Change the config, run cf apply, and everything reconcilesโstacks start, migrate, or stop as needed. See Comparison with Alternatives for how this compares to other approaches.
Before you say itโno, this is not a new standard. I changed nothing about my existing setup. When I added more hosts, I just mounted my drives at the same paths, and everything worked. You can do all of this manually todayโSSH into a host and run docker compose up.
Compose Farm just automates what youโd do by hand:
- Runs
docker composecommands over SSH - Tracks which stack runs on which host
- One command (
cf apply) to reconcile everythingโstart missing stacks, migrate moved ones, stop removed ones - Generates Traefik file-provider config for cross-host routing
Itโs a convenience wrapper, not a new paradigm.
How It Works
The declarative way โ run cf apply and reality matches your config:
- Compose Farm compares your config to whatโs actually running
- Stacks in config but not running? Starts them
- Stacks on the wrong host? Migrates them (stops on old host, starts on new)
- Stacks running but removed from config? Stops them
Under the hood โ each stack operation is just SSH + docker compose:
- Look up which host runs the stack (e.g.,
plexโserver-1) - SSH to
server-1(or run locally iflocalhost) - Execute
docker compose -f /opt/compose/plex/docker-compose.yml up -d - Stream output back with
[plex]prefix
Thatโs it. No orchestration, no service discovery, no magic.
Requirements
- Python 3.11+ (we recommend uv for installation)
- SSH key-based authentication to your hosts (uses ssh-agent)
- Docker and Docker Compose installed on all target hosts
- Shared storage: All compose files must be accessible at the same path on all hosts
- Docker networks: External networks must exist on all hosts (use
cf init-networkto create)
Compose Farm assumes your compose files are accessible at the same path on all hosts. This is typically achieved via:
- NFS mount (e.g.,
/opt/composemounted from a NAS) - Synced folders (e.g., Syncthing, rsync)
- Shared filesystem (e.g., GlusterFS, Ceph)
# Example: NFS mount on all Docker hosts
nas:/volume1/compose โ /opt/compose (on server-1)
nas:/volume1/compose โ /opt/compose (on server-2)
nas:/volume1/compose โ /opt/compose (on server-3)
Compose Farm simply runs docker compose -f /opt/compose/{stack}/docker-compose.yml on the appropriate hostโit doesnโt copy or sync files.
Limitations & Best Practices
Compose Farm moves containers between hosts but does not provide cross-host networking. Dockerโs internal DNS and networks donโt span hosts.
What breaks when you move a stack
- Docker DNS -
http://redis:6379wonโt resolve from another host - Docker networks - Containers canโt reach each other via network names
- Environment variables -
DATABASE_URL=postgres://db:5432stops working
Best practices
Keep dependent services together - If an app needs a database, redis, or worker, keep them in the same compose file on the same host 1.
Only migrate standalone stacks - Stacks whose services donโt talk to other containers (or only talk to external APIs) are safe to move 1.
Expose ports for cross-host communication - If services must communicate across hosts, publish ports and use IP addresses instead of container names:
# Instead of: DATABASE_URL=postgres://db:5432
# Use: DATABASE_URL=postgres://192.168.1.66:5432
This includes Traefik routingโcontainers need published ports for the file-provider to reach them
What Compose Farm doesnโt do
- No overlay networking (use Docker Swarm or Kubernetes for that)
- No service discovery across hosts
- No automatic dependency tracking between compose files
If you need containers on different hosts to communicate seamlessly, you need Docker Swarm, Kubernetes, or a service meshโwhich adds the complexity Compose Farm is designed to avoid.
Installation
# One-liner (installs uv if needed)
curl -fsSL https://compose-farm.nijho.lt/install | sh
# Or if you already have uv/pip
uv tool install compose-farm
pip install compose-farm
๐ณ Docker
Using the provided docker-compose.yml:
docker compose run --rm cf up --all
Or directly:
docker run --rm \
-v $SSH_AUTH_SOCK:/ssh-agent -e SSH_AUTH_SOCK=/ssh-agent \
-v ./compose-farm.yaml:/root/.config/compose-farm/compose-farm.yaml:ro \
ghcr.io/basnijholt/compose-farm up --all
Running as non-root user (recommended for NFS mounts):
By default, containers run as root. To preserve file ownership on mounted volumes (e.g., compose-farm-state.yaml, config edits), set these environment variables:
# Add to .env file (one-time setup)
echo "CF_UID=$(id -u)" >> .env
echo "CF_GID=$(id -g)" >> .env
echo "CF_HOME=$HOME" >> .env
echo "CF_USER=$USER" >> .env
Or use direnv (copies .envrc.example to .envrc):
cp .envrc.example .envrc && direnv allow
SSH Authentication
Compose Farm uses SSH to run commands on remote hosts. There are two authentication methods:
SSH Agent
Works out of the box when running locally if you have an SSH agent running with your keys loaded:
# Verify your agent has keys
ssh-add -l
# Run compose-farm commands
cf up --all
Dedicated SSH Key (default for Docker)
When running in Docker, SSH agent sockets are ephemeral and can be lost after container restarts. The cf ssh command sets up a dedicated key that persists:
# Generate key and copy to all configured hosts
cf ssh setup
# Check status
cf ssh status
This creates ~/.ssh/compose-farm/id_ed25519 (ED25519, no passphrase) and copies the public key to each hostโs authorized_keys. Compose Farm tries the SSH agent first, then falls back to this key.
๐ณ Docker volume options for SSH keys
When running in Docker, mount a volume to persist the SSH keys. Choose ONE option and use it for both cf and web Compose services:
Option 1: Host path (default) - keys at ~/.ssh/compose-farm/id_ed25519
volumes:
- ~/.ssh/compose-farm:${CF_HOME:-/root}/.ssh
Option 2: Named volume - managed by Docker
volumes:
- cf-ssh:${CF_HOME:-/root}/.ssh
Option 3: SSH agent forwarding - if you prefer using your hostโs ssh-agent
volumes:
- ${SSH_AUTH_SOCK}:/ssh-agent:ro
Note: Requires SSH_AUTH_SOCK environment variable to be set. The socket path is ephemeral and changes across sessions.
Run setup once after starting the container (while the SSH agent still works):
docker compose exec web cf ssh setup
The keys will persist across restarts.
Note: When running as non-root (with CF_UID/CF_GID), set CF_HOME to your home directory so SSH finds the keys at the correct path.
Configuration
Create compose-farm.yaml in the directory where youโll run commands (e.g., /opt/stacks). This keeps config near your stacks. Alternatively, use ~/.config/compose-farm/compose-farm.yaml for a global config, or symlink from one to the other with cf config symlink.
Single-host example
No SSH, shared storage, or Traefik file-provider required.
compose_dir: /opt/stacks
hosts:
local: localhost # Run locally without SSH
stacks:
plex: local
jellyfin: local
traefik: local
Multi-host example
compose_dir: /opt/compose # Must be the same path on all hosts
hosts:
server-1:
address: 192.168.1.10
user: docker
server-2:
address: 192.168.1.11
# user defaults to current user
stacks:
plex: server-1
jellyfin: server-2
grafana: server-1
# Multi-host stacks (run on multiple/all hosts)
autokuma: all # Runs on ALL configured hosts
dozzle: [server-1, server-2] # Explicit list of hosts
For cross-host HTTP routing, add Traefik labels to your compose files and set traefik_file so Compose Farm can generate the file-provider config.
Each entry in stacks: maps to a folder under compose_dir that contains a compose file. Compose files are expected at {compose_dir}/{stack}/compose.yaml (also supports compose.yml, docker-compose.yml, docker-compose.yaml).
Multi-Host Stacks
Some stacks need to run on every host. This is typically required for tools that access host-local resources like the Docker socket (/var/run/docker.sock), which cannot be accessed remotely without security risks.
Common use cases:
- AutoKuma - auto-creates Uptime Kuma monitors from container labels (needs local Docker socket)
- Dozzle - real-time log viewer (needs local Docker socket)
- Promtail/Alloy - log shipping agents (needs local Docker socket and log files)
- node-exporter - Prometheus host metrics (needs access to host /proc, /sys)
This is the same pattern as Docker Swarmโs deploy.mode: global.
Use the all keyword or an explicit list:
stacks:
# Run on all configured hosts
autokuma: all
dozzle: all
# Run on specific hosts
node-exporter: [server-1, server-2, server-3]
When you run cf up autokuma, it starts the stack on all hosts in parallel. Multi-host stacks:
- Are excluded from migration logic (they always run everywhere)
- Show output with
[stack@host]prefix for each host - Track all running hosts in state
Config Command
Compose Farm includes a config subcommand to help manage configuration files:
cf config init # Create a new config file with documented example
cf config show # Display current config with syntax highlighting
cf config path # Print the config file path (useful for scripting)
cf config validate # Validate config syntax and schema
cf config edit # Open config in $EDITOR
Use cf config init to get started with a fully documented template.
Usage
The CLI is available as both compose-farm and the shorter cf alias.
Docker Compose Commands
These wrap docker compose with multi-host superpowers:
| Command | Wraps | Compose Farm Additions |
|---|---|---|
cf up | up -d | --all, --host, parallel execution, auto-migration |
cf down | down | --all, --host, --orphaned, state tracking |
cf stop | stop | --all, --service |
cf restart | restart | --all, --service |
cf pull | pull | --all, --service, parallel execution |
cf logs | logs | --all, --host, multi-stack output |
cf ps | ps | --all, --host, unified cross-host view |
cf compose | any | passthrough for commands not listed above |
Compose Farm Commands
Multi-host orchestration that Docker Compose canโt do:
| Command | Description |
|---|---|
cf apply | Reconcile: start missing, migrate moved, stop orphans |
cf update | Shorthand for up --pull --build |
cf refresh | Sync state from whatโs actually running |
cf check | Validate config, mounts, networks |
cf init-network | Create Docker network on all hosts |
cf traefik-file | Generate Traefik file-provider config |
cf config | Manage config files (init, show, validate, edit, symlink) |
cf ssh | Manage SSH keys (setup, status, keygen) |
cf list | List all stacks and their assigned hosts |
Aliases
Short aliases for frequently used commands:
| Alias | Command | Alias | Command |
|---|---|---|---|
cf a | apply | cf s | stats |
cf l | logs | cf ls | list |
cf r | restart | cf rf | refresh |
cf u | update | cf ck | check |
cf p | pull | cf tf | traefik-file |
cf c | compose |
Each command replaces: look up host โ SSH โ find compose file โ run ssh host "cd /opt/compose/plex && docker compose up -d".
# The main command: make reality match your config
cf apply # start missing + migrate + stop orphans
cf apply --dry-run # preview what would change
cf apply --no-orphans # skip stopping orphaned stacks
cf apply --full # also refresh all stacks (picks up config changes)
# Or operate on individual stacks
cf up plex jellyfin # start stacks (auto-migrates if host changed)
cf up --all
cf down plex # stop stacks
cf down --orphaned # stop stacks removed from config
# Pull latest images
cf pull --all
# Restart running containers
cf restart plex
# Update (pull + build, only recreates containers if images changed)
cf update --all
# Update state from reality (discovers running stacks + captures digests)
cf refresh # updates compose-farm-state.yaml and dockerfarm-log.toml
cf refresh --dry-run # preview without writing
# Validate config, traefik labels, mounts, and networks
cf check # full validation (includes SSH checks)
cf check --local # fast validation (skip SSH)
cf check jellyfin # check stack + show which hosts can run it
# Create Docker network on new hosts (before migrating stacks)
cf init-network nuc hp # create mynetwork on specific hosts
cf init-network # create on all hosts
# View logs
cf logs plex
cf logs -f plex # follow
# Show status
cf ps
CLI --help Output
Full --help output for each command. See the Usage table above for a quick overview.
See the output of cf --help
Usage: cf [OPTIONS] COMMAND [ARGS]...
Compose Farm - run docker compose commands across multiple hosts
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --version -v Show version and exit โ
โ --install-completion Install completion for the current shell. โ
โ --show-completion Show completion for the current shell, to โ
โ copy it or customize the installation. โ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Configuration โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ traefik-file Generate a Traefik file-provider fragment from compose โ
โ Traefik labels. โ
โ refresh Update local state from running stacks. โ
โ check Validate configuration, traefik labels, mounts, and networks. โ
โ init-network Create Docker network on hosts with consistent settings. โ
โ config Manage compose-farm configuration files. โ
โ ssh Manage SSH keys for passwordless authentication. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Lifecycle โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ up Start stacks (docker compose up -d). Auto-migrates if host โ
โ changed. โ
โ down Stop stacks (docker compose down). โ
โ stop Stop services without removing containers (docker compose โ
โ stop). โ
โ pull Pull latest images (docker compose pull). โ
โ restart Restart running containers (docker compose restart). โ
โ update Update stacks (pull + build + up). Shorthand for 'up --pull โ
โ --build'. โ
โ apply Make reality match config (start, migrate, stop โ
โ strays/orphans as needed). โ
โ compose Run any docker compose command on a stack. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Monitoring โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ logs Show stack logs. With --service, shows logs for just that โ
โ service. โ
โ ps Show status of stacks. โ
โ stats Show overview statistics for hosts and stacks. โ
โ list List all stacks and their assigned hosts. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Server โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ web Start the web UI server. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Lifecycle
See the output of cf up --help
Usage: cf up [OPTIONS] [STACKS]...
Start stacks (docker compose up -d). Auto-migrates if host changed.
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ stacks [STACKS]... Stacks to operate on โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --all -a Run on all stacks โ
โ --host -H TEXT Filter to stacks on this host โ
โ --service -s TEXT Target a specific service within the stack โ
โ --pull Pull images before starting (--pull always) โ
โ --build Build images before starting โ
โ --config -c PATH Path to config file โ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
See the output of cf down --help
Usage: cf down [OPTIONS] [STACKS]...
Stop stacks (docker compose down).
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ stacks [STACKS]... Stacks to operate on โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --all -a Run on all stacks โ
โ --orphaned Stop orphaned stacks (in state but removed from โ
โ config) โ
โ --host -H TEXT Filter to stacks on this host โ
โ --config -c PATH Path to config file โ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
See the output of cf stop --help
Usage: cf stop [OPTIONS] [STACKS]...
Stop services without removing containers (docker compose stop).
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ stacks [STACKS]... Stacks to operate on โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --all -a Run on all stacks โ
โ --service -s TEXT Target a specific service within the stack โ
โ --config -c PATH Path to config file โ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
See the output of cf pull --help
Usage: cf pull [OPTIONS] [STACKS]...
Pull latest images (docker compose pull).
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ stacks [STACKS]... Stacks to operate on โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --all -a Run on all stacks โ
โ --service -s TEXT Target a specific service within the stack โ
โ --config -c PATH Path to config file โ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
See the output of cf restart --help
Usage: cf restart [OPTIONS] [STACKS]...
Restart running containers (docker compose restart).
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ stacks [STACKS]... Stacks to operate on โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --all -a Run on all stacks โ
โ --service -s TEXT Target a specific service within the stack โ
โ --config -c PATH Path to config file โ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
See the output of cf update --help
Usage: cf update [OPTIONS] [STACKS]...
Update stacks (pull + build + up). Shorthand for 'up --pull --build'.
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ stacks [STACKS]... Stacks to operate on โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --all -a Run on all stacks โ
โ --service -s TEXT Target a specific service within the stack โ
โ --config -c PATH Path to config file โ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
See the output of cf apply --help
Usage: cf apply [OPTIONS]
Make reality match config (start, migrate, stop strays/orphans as needed).
This is the "reconcile" command that ensures running stacks match your
config file. It will:
1. Stop orphaned stacks (in state but removed from config)
2. Stop stray stacks (running on unauthorized hosts)
3. Migrate stacks on wrong host (host in state โ host in config)
4. Start missing stacks (in config but not in state)
Use --dry-run to preview changes before applying.
Use --no-orphans to skip stopping orphaned stacks.
Use --no-strays to skip stopping stray stacks.
Use --full to also run 'up' on all stacks (picks up compose/env changes).
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --dry-run -n Show what would change without executing โ
โ --no-orphans Only migrate, don't stop orphaned stacks โ
โ --no-strays Don't stop stray stacks (running on wrong host) โ
โ --full -f Also run up on all stacks to apply config โ
โ changes โ
โ --config -c PATH Path to config file โ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
See the output of cf compose --help
Usage: cf compose [OPTIONS] STACK COMMAND [ARGS]...
Run any docker compose command on a stack.
Passthrough to docker compose for commands not wrapped by cf.
Options after COMMAND are passed to docker compose, not cf.
Examples:
cf compose mystack --help - show docker compose help
cf compose mystack top - view running processes
cf compose mystack images - list images
cf compose mystack exec web bash - interactive shell
cf compose mystack config - view parsed config
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ * stack TEXT Stack to operate on (use '.' for current dir) โ
โ [required] โ
โ * command TEXT Docker compose command [required] โ
โ args [ARGS]... Additional arguments โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --host -H TEXT Filter to stacks on this host โ
โ --config -c PATH Path to config file โ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Configuration
See the output of cf traefik-file --help
Usage: cf traefik-file [OPTIONS] [STACKS]...
Generate a Traefik file-provider fragment from compose Traefik labels.
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ stacks [STACKS]... Stacks to operate on โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --all -a Run on all stacks โ
โ --output -o PATH Write Traefik file-provider YAML to this path โ
โ (stdout if omitted) โ
โ --config -c PATH Path to config file โ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
See the output of cf refresh --help
Usage: cf refresh [OPTIONS] [STACKS]...
Update local state from running stacks.
Discovers which stacks are running on which hosts, updates the state
file, and captures image digests. This is a read operation - it updates
your local state to match reality, not the other way around.
Without arguments: refreshes all stacks (same as --all).
With stack names: refreshes only those stacks.
Use 'cf apply' to make reality match your config (stop orphans, migrate).
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ stacks [STACKS]... Stacks to operate on โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --all -a Run on all stacks โ
โ --config -c PATH Path to config file โ
โ --log-path -l PATH Path to Dockerfarm TOML log โ
โ --dry-run -n Show what would change without writing โ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
See the output of cf check --help
Usage: cf check [OPTIONS] [STACKS]...
Validate configuration, traefik labels, mounts, and networks.
Without arguments: validates all stacks against configured hosts.
With stack arguments: validates specific stacks and shows host compatibility.
Use --local to skip SSH-based checks for faster validation.
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ stacks [STACKS]... Stacks to operate on โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --local Skip SSH-based checks (faster) โ
โ --config -c PATH Path to config file โ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
See the output of cf init-network --help
Usage: cf init-network [OPTIONS] [HOSTS]...
Create Docker network on hosts with consistent settings.
Creates an external Docker network that stacks can use for cross-host
communication. Uses the same subnet/gateway on all hosts to ensure
consistent networking.
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ hosts [HOSTS]... Hosts to create network on (default: all) โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --network -n TEXT Network name [default: mynetwork] โ
โ --subnet -s TEXT Network subnet [default: 172.20.0.0/16] โ
โ --gateway -g TEXT Network gateway [default: 172.20.0.1] โ
โ --config -c PATH Path to config file โ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
See the output of cf config --help
Usage: cf config [OPTIONS] COMMAND [ARGS]...
Manage compose-farm configuration files.
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Commands โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ init Create a new config file with documented example. โ
โ edit Open the config file in your default editor. โ
โ show Display the config file location and contents. โ
โ path Print the config file path (useful for scripting). โ
โ validate Validate the config file syntax and schema. โ
โ symlink Create a symlink from the default config location to a config โ
โ file. โ
โ init-env Generate a .env file for Docker deployment. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
See the output of cf ssh --help
Usage: cf ssh [OPTIONS] COMMAND [ARGS]...
Manage SSH keys for passwordless authentication.
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Commands โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ keygen Generate SSH key (does not distribute to hosts). โ
โ setup Generate SSH key and distribute to all configured hosts. โ
โ status Show SSH key status and host connectivity. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Monitoring
See the output of cf logs --help
Usage: cf logs [OPTIONS] [STACKS]...
Show stack logs. With --service, shows logs for just that service.
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ stacks [STACKS]... Stacks to operate on โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --all -a Run on all stacks โ
โ --host -H TEXT Filter to stacks on this host โ
โ --service -s TEXT Target a specific service within the stack โ
โ --follow -f Follow logs โ
โ --tail -n INTEGER Number of lines (default: 20 for --all, 100 โ
โ otherwise) โ
โ --config -c PATH Path to config file โ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
See the output of cf ps --help
Usage: cf ps [OPTIONS] [STACKS]...
Show status of stacks.
Without arguments: shows all stacks (same as --all).
With stack names: shows only those stacks.
With --host: shows stacks on that host.
With --service: filters to a specific service within the stack.
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ stacks [STACKS]... Stacks to operate on โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --all -a Run on all stacks โ
โ --host -H TEXT Filter to stacks on this host โ
โ --service -s TEXT Target a specific service within the stack โ
โ --config -c PATH Path to config file โ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
See the output of cf stats --help
Usage: cf stats [OPTIONS]
Show overview statistics for hosts and stacks.
Without flags: Shows config/state info (hosts, stacks, pending migrations).
With --live: Also queries Docker on each host for container counts.
With --containers: Shows per-container resource stats (requires Glances).
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --live -l Query Docker for live container stats โ
โ --containers -C Show per-container resource stats (requires โ
โ Glances) โ
โ --host -H TEXT Filter to stacks on this host โ
โ --config -c PATH Path to config file โ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
See the output of cf list --help
Usage: cf list [OPTIONS]
List all stacks and their assigned hosts.
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --host -H TEXT Filter to stacks on this host โ
โ --simple -s Plain output (one stack per line, for scripting)