doco-cd with Docker: push to Git and your server deploys (Linux, Windows, Mac)
Before you start
- 25 min read
Boxes marked Run in terminal are what you type; plain text explains why. Check what you need first

What you get in one minute#
doco-cd is a free, open-source GitOps tool for Docker Compose: you keep your Compose files in a Git repository, and a small container on your server deploys every change you push, so Git always says what runs.
Logo: doco-cd project, Kim Oliver Drechsel (file wiki/docs/images/doco-cd_logo.svg), CC BY-ND 4.0, shown unchanged.
You edit a file, run git push, and minutes later (seconds, with a webhook) your containers match the file. Rolling back is a git revert. We pair it with our Forgejo Git server; GitHub, GitLab, Gitea and others work too.
| What | Value (official sources, read 5 December 2026) |
|---|---|
| Current version | doco-cd v0.139.0, released 30 November 2026 (previous: v0.138.0, 26 November) |
| Image to pin | ghcr.io/kimdre/doco-cd:0.139.0 (tag checked on ghcr.io; amd64, arm64, arm/v7) |
| Time and size | About 30 minutes (our estimate); about 77 MB compressed for amd64 (registry manifest) |
| Ports | None for polling. A webhook needs port 80 inside the container, behind HTTPS |
| Licence | Apache-2.0 (LICENSE at the release tag) |
| Official docs | doco.cd |
At a glance:
- What it is: one small container with the Docker socket mounted. It clones your repository and runs
docker compose up -dfor you on every change. - How it learns about a push: it polls every 3 minutes by default, or your Git server calls its webhook. You can use both.
- What it needs: a repository with Compose files and one small file,
.doco-cd.yml. - Risk to know first: it controls Docker on your host, so whoever can push to the repository can run containers there. See Security.
- Not an update notifier: use Diun for "new image" messages.
Releases come about weekly. On 5 December 2026 the tracker had 13 open issues, one labelled a bug, so the latest release is fine. We still pin it, because some releases need action (see Updates).
How it fits together#
You push to Git. doco-cd, running next to your apps, learns about the push (it polls, or Forgejo sends a webhook through your HTTPS proxy), fetches the files and tells Docker to create or update the containers.
Drawn for this guide from the official docs. The dashed path is optional: polling alone works.
Three kinds of file drive it:
| Where | File | What it does |
|---|---|---|
| Server | doco-cd's own compose.yaml and .env | Runs doco-cd, holds the Git token and the trigger settings |
| Git, root | .doco-cd.yml | Says which apps to deploy and where |
| Git, per app | compose.yaml | The normal Compose file of the app |
Before you start#
Note: every domain, token and password on this page is a dummy example (
git.example.com,<your-forgejo-read-token>). Replace it with your own, and never commit real secrets to Git.
| System | What to have |
|---|---|
| Linux | Docker Engine, the Compose plugin and Git. This is the normal target: an always-on server |
| Windows | Windows 10 or later, Docker Desktop (WSL 2 backend), Git for Windows, PowerShell |
| Mac | Docker Desktop (Intel or Apple Silicon), Git |
docker --version docker compose version git --version
You also need a Git server with a private repository (we use Forgejo).
Checklist:
- [ ] All three commands print a version
- [ ] You can create a repository on your Git server
- [ ] You know your time zone name, such as
Europe/London - [ ] For the webhook only: a domain, a DNS record, and ports 80 and 443 open
Tested by DIY Lab Hub: not yet. Commands come from the official docs at v0.139.0, read on 5 December 2026; we ran nothing on a real machine. The docs describe a Docker host and do not mention Docker Desktop, so use Windows and Mac to try the idea and run the real thing on a Linux server.
LLM Guide: let your AI assistant set it up#
Prefer to let an AI do the typing? Copy the block below into ChatGPT, Claude, Gemini or a local model. It first asks about your setup (system, Git server, polling or webhook, reverse proxy), then follows only the path that fits you. It uses the same pinned versions as this guide. You still read each command before you run it.
You are my assistant for installing doco-cd (GitOps for Docker Compose: I keep Compose files in a Git repository and a small container on my server deploys every push) with Docker.
Follow the DIY Lab Hub guide https://diylabhub.com/doco-cd/ (checked 5 December 2026).
Work one step at a time. Before each command, say in one line what it does. Wait for my OK before anything that deletes data, stops a service, changes my router or opens a port.
Tell me once: doco-cd mounts the Docker socket, so whoever can push to the watched branch can run containers on that host. Protect the branch and limit who can push.
STEP 0 - FIND OUT MY SETUP. Ask me these questions (or have me run the read-only checks) before you do anything else:
1. Which machine will run doco-cd: a Linux server (the normal target), or Windows or Mac with Docker Desktop (fine to try the idea; the docs describe a Docker host only)?
2. Are Docker, the Compose plugin and Git installed? Check: docker --version, docker compose version and git --version
3. Which Git server holds my repository: Forgejo (the guide's choice), GitHub, GitLab, Gitea or another? What is its host name, and is the repository private? (git.example.com is only an example.)
4. How should doco-cd learn about a push: polling every 3 minutes (the default; needs no open port and is the docs' advice), or also a webhook (needs HTTPS, a domain, DNS and ports 80 and 443)?
5. For a webhook: do I already run Traefik, Caddy, nginx / Nginx Proxy Manager, or none? Public domain or home only?
6. My time zone name (for example Europe/London).
THEN FOLLOW THE MATCHING PATH:
- Docker or Git missing: install them from docs.docker.com or git-scm.com first, then come back.
- Polling only (the guide's main path): no proxy and no published port; use the files below.
- Webhook: add WEBHOOK_SECRET=<random value> to .env (Linux/Mac: printf 'WEBHOOK_SECRET=%s\n' "$(openssl rand -hex 32)" >> .env) and WEBHOOK_SECRET: ${WEBHOOK_SECRET:?Set WEBHOOK_SECRET in .env} under environment:. Without it the webhook stays off. In Forgejo: Settings, Webhooks, Add webhook, Gitea; target https://deploy.example.com/v1/webhook, POST, application/json, the same secret, push events, branch main. If Forgejo calls a private address, set FORGEJO__webhook__ALLOWED_HOST_LIST to that host name.
- Webhook with Traefik (Traefik v3, external network "proxy", entrypoint "https", resolver "le"): add networks: proxy to the doco-cd service, networks: proxy: external: true at the bottom, and these labels (the domain is an example; the router matches only the webhook path):
traefik.enable=true
traefik.docker.network=proxy
traefik.http.routers.doco-cd.rule=Host(`deploy.example.com`) && PathPrefix(`/v1/webhook`)
traefik.http.routers.doco-cd.entrypoints=https
traefik.http.routers.doco-cd.tls=true
traefik.http.routers.doco-cd.tls.certresolver=le
traefik.http.services.doco-cd.loadbalancer.server.port=80
- Webhook without Traefik: use Caddy 2.11.9 on the same "proxy" network as in the guide's Caddy route, with a Caddyfile that sends only /v1/webhook* to doco-cd:80 and answers 404 for everything else. Public domain = automatic Let's Encrypt. Home only = add "tls internal" and trust Caddy's root certificate (Forgejo then also needs to trust it). Never publish port 80 of doco-cd on the host, and never publish the metrics port 9120.
STEP A - THE REPOSITORY (a new private repository, for example "homelab", with no README):
Create a read-only token in my Git server (Forgejo: Settings, Applications; repository and organisation access All, permission repository = Read). I keep the token; never ask me for it. Put two files in the repository root, commit and push to main:
.doco-cd.yml:
name: whoami
working_dir: whoami
whoami/compose.yaml:
services:
hello:
image: traefik/whoami:v1.12.0
restart: unless-stopped
environment:
- WHOAMI_NAME=first-deploy
ports:
- "127.0.0.1:8080:80"
STEP B - DOCO-CD ON THE SERVER (folder ~/docker_volumes/doco-cd with data and backups; Windows: $HOME\docker_volumes\doco-cd):
.env (chmod 600 on Linux/Mac): GIT_ACCESS_TOKEN=<my-read-token> (I paste it into the file myself)
compose.yaml (keep this exact version):
services:
app:
container_name: doco-cd
image: ghcr.io/kimdre/doco-cd:0.139.0
restart: unless-stopped
environment:
TZ: <my-timezone>
GIT_ACCESS_TOKEN: ${GIT_ACCESS_TOKEN}
GIT_AUTH_DOMAINS: "- domains: [git.example.com]"
POLL_CONFIG: |
- url: https://git.example.com/<my-user>/homelab.git
reference: main
interval: 180
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./data:/data
cap_drop:
- ALL
healthcheck:
start_period: 15s
interval: 30s
timeout: 5s
retries: 3
Replace git.example.com, <my-user> and <my-timezone> with my values. GIT_AUTH_DOMAINS is mandatory since v0.130.0 (the token is sent only to the hosts listed). Check: docker compose config -q (prints nothing when valid; never share full "docker compose config" output, it shows the token). Start: docker compose up -d
CHECK IT WORKED:
- docker compose ps shows doco-cd healthy within about a minute; docker compose logs --tail=50 app shows "polling repository" and then "job completed successfully".
- curl -i http://127.0.0.1:8080 (Windows: curl.exe) answers 200 and contains "Name: first-deploy".
- Change first-deploy to second-deploy in whoami/compose.yaml, commit and push. After the next poll (up to 3 minutes) the answer shows "Name: second-deploy". To roll back: git revert HEAD and push.
- With a webhook: Forgejo's Test Delivery succeeds and a push deploys within seconds.
RULES FOR YOU:
- Use only the versions and settings above. Do not switch to :latest and do not invent options (no auto_discover, destroy_opts or build_opts; no token without GIT_AUTH_DOMAINS; never GIT_AUTH_ALLOW_ANY_HOST). If a step fails, show me the exact error and read https://doco.cd/latest/ before guessing.
- Persistent data of deployed apps must be a named volume or an absolute host path, never a relative ./data bind mount in the repository. Name each project once; Docker cannot rename it.
- Never put secrets into the Git repository or labels. Never expose the Docker socket or doco-cd's port to the internet.
- git.example.com, deploy.example.com and <my-user> are examples; ask me for mine.
- Never ask me to paste passwords, tokens or keys into this chat.
Step 1: Create the repository and the token#
We start with polling: it needs no open port and is the docs' advice. In your Forgejo web page (same clicks on every system):
- Create a new private repository named
homelab. Add no README and no licence: an empty repository avoids a rejected first push. - Make a read-only token for doco-cd: Settings, Applications, Generate New Token. The docs say: set the repository and organisation access to
Alland the permissionrepositorytoRead. Copy the token now. It is shown once.
Now put two files in the repository: .doco-cd.yml (the deploy file) and one test app, whoami, a tiny web server from Traefik that prints what it receives. Replace <your-forgejo-user> with your Forgejo user name (a dummy value here).
Linux#
git clone "https://git.example.com/<your-forgejo-user>/homelab.git"
cd homelab
mkdir whoami
cat > .doco-cd.yml << 'EOF'
name: whoami
working_dir: whoami
EOF
cat > whoami/compose.yaml << 'EOF'
services:
hello:
image: traefik/whoami:v1.12.0
restart: unless-stopped
environment:
- WHOAMI_NAME=first-deploy
ports:
- "127.0.0.1:8080:80"
EOF
git add .
git commit -m "Add doco-cd config and whoami"
git branch -M main
git push -u origin main
Windows (PowerShell)#
git clone "https://git.example.com/<your-forgejo-user>/homelab.git"
Set-Location homelab
New-Item -ItemType Directory -Force whoami | Out-Null
@'
name: whoami
working_dir: whoami
'@ | Set-Content -Encoding ascii .doco-cd.yml
@'
services:
hello:
image: traefik/whoami:v1.12.0
restart: unless-stopped
environment:
- WHOAMI_NAME=first-deploy
ports:
- "127.0.0.1:8080:80"
'@ | Set-Content -Encoding ascii whoami\compose.yaml
git add .
git commit -m "Add doco-cd config and whoami"
git branch -M main
git push -u origin main
Mac (Terminal)#
Same commands as Linux.
Git asks for your own Forgejo login here, separate from doco-cd's read-only token. The name is the Compose project name (lowercase letters, numbers, hyphens, underscores). Choose it with care: Docker cannot rename a project later (Known Limitations page).
Check it worked. Your repository page in Forgejo shows .doco-cd.yml and the whoami folder on branch main.
Tip: The file must be
.doco-cd.yml(or.doco-cd.yaml) in the repository root, on the branch doco-cd watches. Otherwise the log saysconfiguration file not found in repository.
Step 2: Write doco-cd's own Compose file#
This runs on your server, not in Git. It follows the official sample, with three changes of ours: a pinned tag instead of latest, a data folder under ~/docker_volumes, and no published port (polling needs none).
Linux#
mkdir -p ~/docker_volumes/doco-cd/{data,backups}
cd ~/docker_volumes/doco-cd
cat > .env << 'EOF'
GIT_ACCESS_TOKEN=<your-forgejo-read-token>
EOF
chmod 600 .env
cat > compose.yaml << 'EOF'
services:
app:
container_name: doco-cd
image: ghcr.io/kimdre/doco-cd:0.139.0
restart: unless-stopped
environment:
TZ: <your-timezone>
GIT_ACCESS_TOKEN: ${GIT_ACCESS_TOKEN}
GIT_AUTH_DOMAINS: "- domains: [git.example.com]"
POLL_CONFIG: |
- url: https://git.example.com/<your-forgejo-user>/homelab.git
reference: main
interval: 180
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./data:/data
cap_drop:
- ALL
healthcheck:
start_period: 15s
interval: 30s
timeout: 5s
retries: 3
EOF
Windows (PowerShell)#
$base = "$HOME\docker_volumes\doco-cd"
foreach ($d in "data","backups") { New-Item -ItemType Directory -Force "$base\$d" | Out-Null }
Set-Location $base
@'
GIT_ACCESS_TOKEN=<your-forgejo-read-token>
'@ | Set-Content -Encoding ascii .env
@'
services:
app:
container_name: doco-cd
image: ghcr.io/kimdre/doco-cd:0.139.0
restart: unless-stopped
environment:
TZ: <your-timezone>
GIT_ACCESS_TOKEN: ${GIT_ACCESS_TOKEN}
GIT_AUTH_DOMAINS: "- domains: [git.example.com]"
POLL_CONFIG: |
- url: https://git.example.com/<your-forgejo-user>/homelab.git
reference: main
interval: 180
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./data:/data
cap_drop:
- ALL
healthcheck:
start_period: 15s
interval: 30s
timeout: 5s
retries: 3
'@ | Set-Content -Encoding ascii compose.yaml
Mac (Terminal)#
Same commands as Linux.
Replace <your-forgejo-read-token>, <your-timezone>, git.example.com and <your-forgejo-user> with your own values. These are dummies. The less obvious lines:
| Line | Why |
|---|---|
GIT_AUTH_DOMAINS | Since v0.130.0 doco-cd sends your token only to the hosts listed here, and refuses to start if a token has no host list. Put your Git server's host name here |
POLL_CONFIG | A YAML list. reference is the branch, interval is in seconds (3m also works, minimum 10 seconds) |
./data:/data | Doco-CD's store of cloned sources. The official file uses a named volume; both work |
| Docker socket | Mounted as in the official file. It gives doco-cd full control of Docker |
Check it worked. docker compose config -q prints nothing if the file is valid. Never share full docker compose config output: it shows the token.
Tip: Keep the token in
.envwithchmod 600, never incompose.yamlor Git. Avoid$,#, spaces and quotes in.envvalues: Compose reads them as syntax.
Step 3: Start doco-cd and watch the first deploy#
Linux#
cd ~/docker_volumes/doco-cd docker compose up -d docker compose ps docker compose logs --tail=50 app curl -i http://127.0.0.1:8080
Windows (PowerShell)#
Set-Location "$HOME\docker_volumes\doco-cd" docker compose up -d docker compose ps docker compose logs --tail=50 app curl.exe -i http://127.0.0.1:8080
Mac (Terminal)#
Same commands as Linux.
We did not run this, so we show no real output. The docs say a healthy start logs polling repository then job completed successfully, and the whoami test answers HTTP/1.1 200 OK.
Check it worked. docker compose ps shows doco-cd as healthy within about a minute (first starting). The log has no error line. The curl answer contains Name: first-deploy. Doco-CD polls once right after it starts, so the app is usually up within a minute or two. If it does not start, the log names the setting it cannot use.
Step 4: Change a file and watch Git deploy it#
This is the whole point. Change the name in the repository and push.
Linux#
cd homelab sed -i 's/first-deploy/second-deploy/' whoami/compose.yaml git commit -am "Rename the whoami app" git push
Windows (PowerShell)#
Set-Location homelab (Get-Content whoami\compose.yaml) -replace 'first-deploy','second-deploy' | Set-Content -Encoding ascii whoami\compose.yaml git commit -am "Rename the whoami app" git push
Mac (Terminal)#
cd homelab sed -i '' 's/first-deploy/second-deploy/' whoami/compose.yaml git commit -am "Rename the whoami app" git push
On a Mac the empty quotes after -i are required.
Check it worked. After the next poll (up to 3 minutes) curl http://127.0.0.1:8080 (Windows: curl.exe) shows Name: second-deploy. Follow it live with docker compose logs -f app.
Tip: To roll back,
git revert HEADand push. Git, not your memory, is the record of what ran.
Adding apps and keeping their data safe#
Each app gets its own folder and its own Compose file. List them in .doco-cd.yml as separate YAML documents divided by ---:
name: whoami working_dir: whoami --- name: my-second-app working_dir: my-second-app
Or let doco-cd find the folders: working_dir: apps plus auto_discovery: true. Since v0.107.0 its delete setting is off. Three rules from the docs surprise beginners:
- Persistent data must not live in the repository folder. Doco-CD deploys every revision from its own copy of the repository, so data written to a relative bind mount such as
./data:/datais lost with the next revision. Use a named volume, or an absolute host path such as/home/<your-user>/docker_volumes/my-second-app/data:/data(a dummy user name). We would not use~there: Compose runs inside the doco-cd container, so~would not mean your home folder (our reasoning, not tested). - Deleting an app's files from Git does not remove its containers. Add
destroy: trueto its entry to remove it. That default also removes its volumes and images, so use the long form to keep the data:
name: my-second-app working_dir: my-second-app destroy: enabled: true remove_volumes: false
remove_orphansandprune_imagesare on by default. Containers no longer in an app's Compose file are removed, and unused images are pruned after a deploy.
To move an app that already runs, read the docs' "Migrating from Docker Compose" page first. Check it worked. After the next poll docker compose ls lists every name from .doco-cd.yml as a running project.
Tip: Doco-CD only manages what it deployed. Apps you started by hand stay as they are until you move them into Git.
Put it behind HTTPS (with or without Traefik)#
You only need this for the webhook. Polling opens no port, so a home server can stop here. A webhook starts deploys within seconds, but Forgejo must reach doco-cd, and the docs say to use HTTPS. Both routes need a DNS record such as deploy.example.com (a dummy) pointing to the server, and ports 80 and 443 open. First make a webhook secret (any long random string).
Linux#
cd ~/docker_volumes/doco-cd printf 'WEBHOOK_SECRET=%s\n' "$(openssl rand -hex 32)" >> .env
Windows (PowerShell)#
Set-Location "$HOME\docker_volumes\doco-cd"
$b = New-Object byte[] 32
[Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($b)
"WEBHOOK_SECRET=" + (($b | ForEach-Object { $_.ToString('x2') }) -join '') | Add-Content -Encoding ascii .env
Mac (Terminal)#
Same commands as Linux.
Add WEBHOOK_SECRET: ${WEBHOOK_SECRET:?Set WEBHOOK_SECRET in .env} under environment: in doco-cd's compose.yaml. Without it the webhook endpoint stays off. You paste the same secret into Forgejo later (grep WEBHOOK_SECRET .env shows it).
With Traefik#
On a server that already runs Traefik v3 (our Traefik guide), put doco-cd on the proxy network and add labels. Create the network once if missing: docker network create proxy. The router matches only the webhook path (our choice, not from the docs). Add this to the doco-cd service, and the networks: block at the end of the file:
networks:
- proxy
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.routers.doco-cd.rule=Host(`deploy.example.com`) && PathPrefix(`/v1/webhook`)"
- "traefik.http.routers.doco-cd.entrypoints=https"
- "traefik.http.routers.doco-cd.tls=true"
- "traefik.http.routers.doco-cd.tls.certresolver=le"
- "traefik.http.services.doco-cd.loadbalancer.server.port=80"
networks:
proxy:
external: true
https, le and proxy are the names from our Traefik guide. Run docker compose up -d again. Port 80 is doco-cd's default HTTP_PORT inside the container; do not publish it on the host.
Without Traefik: Caddy#
Choose this if you have no Traefik. Caddy gets and renews its own certificates.
With a public domain (DNS A record, ports 80 and 443 open) Caddy uses Let's Encrypt. At home with no domain use tls internal, Caddy's own local certificate, and trust its root on each device (see the Forgejo note below).
Put doco-cd on the shared proxy network (the networks lines above, no labels) and run Caddy in Docker on it, as in our Caddy guide. The Caddyfile for a public domain:
deploy.example.com {
handle /v1/webhook* {
reverse_proxy doco-cd:80
}
handle {
respond 404
}
}
For a home-only name, use tls internal:
deploy.home.arpa {
tls internal
handle /v1/webhook* {
reverse_proxy doco-cd:80
}
handle {
respond 404
}
}
If Caddy runs on the host, publish doco-cd on the loopback only, as the official sample does ("127.0.0.1:8080:80"), and write reverse_proxy 127.0.0.1:8080.
Check it worked (both routes). curl -I https://deploy.example.com/v1/webhook should answer over HTTPS. We did not run it: a request without a payload should get an error status, which still proves the route and the certificate. Other paths, such as /, must not reach doco-cd.
Add the webhook in Forgejo#
In the repository open Settings, Webhooks, Add webhook, Gitea and fill in (per the docs):
| Field | Value |
|---|---|
| Target URL | https://deploy.example.com/v1/webhook |
| HTTP Method | POST |
| POST Content Type | application/json |
| Secret | the WEBHOOK_SECRET from .env |
| Trigger On | Push Events |
| Branch filter | main (the docs also allow *) |
| Active | on |
Then use Test Delivery. Two Forgejo settings often block the first delivery (set them in Forgejo's environment, the FORGEJO__section__KEY form from our Forgejo guide):
FORGEJO__webhook__ALLOWED_HOST_LIST: the defaultexternalallows only public addresses. Ifdeploy.example.comresolves to a private address (home DNS), set it to that host name, as the doco-cd docs do.privateallows all private targets.FORGEJO__webhook__SKIP_TLS_VERIFY: off by default. Withtls internalForgejo does not trust Caddy's root and the delivery fails. Our advice: install the root in Forgejo's container; this setting is the quick, less safe way.
Forgejo's DELIVER_TIMEOUT is 5 seconds. Doco-CD answers at once and deploys in the background, so leave ?wait=true off.
Check it worked. The delivery history in Forgejo shows a success, and a push deploys within seconds. With LOG_LEVEL: debug doco-cd logs received webhook event (a debug line in the issue we read).
Optional: clone through the internal network#
The webhook payload carries Forgejo's public clone address, so deploys fail when your proxy or DNS is down (issue 1607). Since v0.106.0 (5 August 2026) you can rewrite the address. Forgejo and doco-cd must share a Docker network (both on proxy). Use these environment: lines, with both hosts listed because the credential follows the rewritten host while status reporting uses the original (docs):
GIT_AUTH_DOMAINS: |
- domains: [git.example.com, forgejo]
SOURCE_URL_REWRITES: |
"https://git.example.com/": "http://forgejo:3000/"
Use the prefix form with the scheme: the docs' host-only form keeps https, which Forgejo's port 3000 does not speak. We did not run this.
Security and testing#
| Control | How |
|---|---|
| Docker socket | Root-level power over the host. The docs: only let repositories you trust trigger deployments here |
| Who can push | Whoever can push to the watched branch can start containers with any image. In Forgejo, protect main and limit writers (our advice) |
| Git token | Read-only, scoped by GIT_AUTH_DOMAINS. Never set GIT_AUTH_ALLOW_ANY_HOST: the docs call it insecure |
| Webhook | Long random secret, HTTPS only, router limited to /v1/webhook. Do not publish the metrics port 9120 |
| Socket proxy | The docs list the exact Docker API endpoints doco-cd uses and a Tecnativa docker-socket-proxy example. It limits the damage; doco-cd still must create and delete containers |
Keep secrets out of Git. The docs support SOPS with age: encrypt a file with the public key, commit it, and give doco-cd the secret key through SOPS_AGE_KEY_FILE; it decrypts in its own copy of the source. Password-manager providers (1Password, Bitwarden, Infisical, OpenBao and others) are on the docs' External Secrets page. Caveat from the docs: decrypted files can stay in the data folder, so "encrypted in Git" is not "never plain text on the host".
Notifications go through an Apprise API container (APPRISE_API_URL, APPRISE_NOTIFY_URLS), not doco-cd itself. Repeated identical failures are sent once an hour by default.
Quick tests:
cd ~/docker_volumes/doco-cd docker compose ps docker compose logs --tail=100 app docker compose ls
How doco-cd compares#
| Tool | What it is | Pick it when |
|---|---|---|
| doco-cd | No web page. Git decides, a container applies it | Everything in Git, no extra UI to secure |
| Komodo | Web UI for servers and stacks. Its docs say Compose files can live in Git with a webhook redeploy on push | A UI, many servers and builds in one place |
| Dockge | Browser editor for Compose files kept as plain files. We found no Git feature in its README | Editing stacks by hand in a browser |
| Diun | Tells you when an image has a new version, changes nothing | Only a message. Pairs well with doco-cd |
Woodpecker CI is a different job: it builds and tests code. We have not tested CI plus doco-cd together.
Common mistakes#
| Mistake | Why it happens | Do this instead |
|---|---|---|
doco-cd will not start with global Git HTTP(S) credentials must be scoped with GIT_AUTH_DOMAINS | Since v0.130.0 a token needs a host list (release) | Add GIT_AUTH_DOMAINS: "- domains: [git.example.com]" |
Webhook rejected with incorrect secret key and HMAC verification failed (issue 545) | The secret differs between Forgejo and doco-cd. In the issue a trailing newline in a *_FILE secret did it (fixed in 2025) | Paste the same secret in both places; for files use printf '%s' |
Private clone fails with authentication required: Unauthorized (issue 1212) | A token that cannot read, or a wrong host in GIT_AUTH_DOMAINS. In the issue the maintainer suspected a trailing newline; the reporter found another cause (doco-cd managing its own Swarm stack) | Re-create the token with repository: Read, check the host, test with git clone |
configuration file not found in repository: .doco-cd.y(a)ml (issue 1433) | The file is missing from the root, not pushed, or on another branch. The issue's trigger was discovery with no Compose file | Put .doco-cd.yml in the root of the watched branch |
additional properties 'pre_start' not allowed (issue 1499) | Works with your Compose, but doco-cd carries its own Compose library and an old release did not know the keyword | Update doco-cd (fixed in v0.95.0) |
| Webhooks fail when the proxy or DNS is down (issue 1607) | The payload carries the public clone address | Use SOURCE_URL_REWRITES (above) or poll |
| App data vanishes after a deploy | A relative bind mount (./data) points into a revision copy | Named volume or an absolute host path |
Forgejo shows webhook can only call allowed HTTP servers (check your webhook.ALLOWED_HOST_LIST setting) | Forgejo blocks private targets by default | Set FORGEJO__webhook__ALLOWED_HOST_LIST (above) |
AI assistants: auto_discover: true with auto_discover_opts, destroy_opts or build_opts | Replaced in v0.85.0; old tutorials still show them | Use auto_discovery, destroy, build |
AI assistants: a GIT_ACCESS_TOKEN setup with no GIT_AUTH_DOMAINS | Written before v0.130.0 | Always add the host list |
Tip: After every push, read the log. The docs say a deployment that fails after its containers were created is retried on every following trigger, so one bad commit repeats its failure at each poll until you push a fix.
Tip: Name the project once and keep it. Docker cannot rename a Compose project, so a new
namecreates a second project beside the old one.
Troubleshooting#
| Problem | Solution |
|---|---|
| Nothing happens after a push | Polling: check URL, branch and interval in POLL_CONFIG, then wait one interval. Webhook: read the delivery history in Forgejo |
| Clone fails | docker compose logs app. Check the token permission, GIT_AUTH_DOMAINS and that the server can reach the repository |
doco-cd restarts or is unhealthy | The log names the setting it cannot use, such as invalid POLL_CONFIG YAML or both GIT_ACCESS_TOKEN and GIT_ACCESS_TOKEN_FILE set |
| Compose error or port in use | docker compose config --quiet in your repository folder. Your apps' ports are separate from doco-cd's |
| Need more detail | Set LOG_LEVEL: debug, run docker compose up -d |
| Poll now | docker compose kill --signal=HUP app runs all poll jobs once (docs) |
Exact error texts#
The other messages are in the Common mistakes table, each with its issue link. Three more:
global Git HTTP(S) credentials must be scoped with GIT_AUTH_DOMAINS: GIT_ACCESS_TOKEN is set, but no GIT_AUTH_DOMAINS entry lists the hosts that may receive it.(official Git Settings page)403 Forbidden ... Request forbidden by administrative rules.from a deploy through a socket proxy: the proxy blocks an endpoint doco-cd needs. Check the proxy log and the docs' endpoint table- Forgejo:
webhook can only call allowed HTTP servers (check your webhook.ALLOWED_HOST_LIST setting). The same text shows in a Gitea report and in Forgejo's source
Known bugs (open, December 2026)#
Issue 1901: two doco-cd instances reaching the same Docker daemon both start the same scheduled job, so run one per daemon. Nothing open stops a normal single-instance install.
Updates and backups#
Update doco-cd. Read the release notes first. Three past releases needed action: v0.85.0 renamed deploy settings, v0.107.0 turned auto_discovery.delete off, v0.130.0 made GIT_AUTH_DOMAINS mandatory. Change the tag in compose.yaml, then:
cd ~/docker_volumes/doco-cd docker compose pull docker compose up -d docker compose logs --tail=50 app
The docs also describe a self-updating setup (doco-cd redeploys itself from Git) and recommend it for new installs. We did not cover it.
What to back up. Your real state is the Git repository, so back up Forgejo (our Forgejo and docker-volume-backup guides). Here only .env and compose.yaml matter. The data folder holds copies of sources that Git can rebuild (our reading of the docs, not a tested restore).
Linux and Mac#
Save as ~/docker_volumes/doco-cd/backup.sh:
#!/usr/bin/env bash set -euo pipefail base="$HOME/docker_volumes/doco-cd" out="$base/backups/doco-cd-$(date +%F).tar.gz" tar -czf "$out" -C "$base" .env compose.yaml chmod 600 "$out"
Run chmod 700 on it and add this line with crontab -e (on a Mac write /Users/<your-user>/...):
0 3 * * * /home/<your-user>/docker_volumes/doco-cd/backup.sh
Windows (PowerShell)#
Save as $HOME\docker_volumes\doco-cd\backup.ps1:
$base = "$HOME\docker_volumes\doco-cd" $out = "$base\backups\doco-cd-$(Get-Date -Format yyyy-MM-dd).tar.gz" tar.exe -czf $out -C $base .env compose.yaml
In Task Scheduler run powershell.exe -NoProfile -File <full-path-to-the-script> daily at 03:00.
Restore test#
Unpack the archive into a spare folder on a test machine without your real apps (so nothing deploys twice), create an empty data folder, then docker compose up -d. The log should show polling repository and job completed successfully again.
Performance and resources#
The README promises "tiny RAM and CPU requirements". We measured nothing; run docker stats doco-cd. The image is about 77 MB compressed (amd64). Load depends on the poll interval (default 180 seconds, minimum 10), MAX_CONCURRENT_DEPLOYMENTS (default 4) and the number of apps. An artifact garbage collector is on by default (ARTIFACT_GC_ENABLED, every 10 minutes, keeping the 2 newest unreferenced artifacts per source), so the data folder should not grow without limit.
FAQ#
Does doco-cd update my images? Not on its own. It deploys what Git says. force_image_pull: true pulls a newer image under the same tag at each deploy. For "new version" messages use Diun; the docs also have a Renovate page that we did not read in depth.
Do I need the webhook? No. Polling needs no open port and is slower by at most one interval. Both can run together.
Which Git servers work? GitHub, GitLab, Gitea, Forgejo, Gogs and plain Git servers. Azure DevOps works only by polling or a custom sender.
Is a Docker socket proxy possible? Yes, the docs list the endpoints and show a Tecnativa example (our docker-socket-proxy guide). It narrows access, but a deployment tool still needs write rights.
How do I pause an app without deleting it? pause: true in its entry freezes updates and leaves workloads running (docs). Swarm mode exists too; we did not cover it.
Sources#
- doco-cd documentation doco.cd and repository github.com/kimdre/doco-cd; release v0.139.0 (30 November 2026); LICENSE (Apache-2.0) - read 5 December 2026
- Docs source at tag v0.139.0 (December 2026), folder wiki/docs: Getting-Started, Core-Concepts, Deploy-Settings, Poll-Settings, App-Settings, Git-Settings, Setup-Webhook, Setup-Access-Token, Known-Limitations, Endpoints/Webhook-Listener, Advanced/Source-URL-Rewrites, Advanced/Docker-API-Permissions, Advanced/Encryption, Advanced/Notifications, Reference/Artifact-Storage; and the sample docker-compose.yml
- Releases: v0.85.0 (6 May 2026), v0.107.0 (10 August 2026), v0.130.0 (25 October 2026)
- Image tags on ghcr.io (registry API checked for
0.139.0) - Forgejo: configuration cheat sheet (
[webhook]section, December 2026) and the webhook delivery source - Komodo: Resources (Stack); Dockge: README (December 2026); traefik/whoami README and release v1.12.0 (December 2026)
- Issues read: 545, 1212, 1433, 1499, 1607, 1901 and Gitea 20163
Checked against the official docs on 2026-12-05. Nothing was run on a real machine by DIY Lab Hub; the commands come from the docs, the source and the issues above.