Compose files are the right way to describe a stack and a tedious way to operate one. Restarting a container over SSH to read twenty lines of logs gets old quickly. Portainer vs Dockge is the usual shortlist for putting a web interface on top of Docker, and they answer the problem from opposite ends.
The real risk: drift
Before either tool, understand the failure mode. You tweak an environment variable in the GUI at midnight, it works, you move on. Six months later you rebuild the host from your compose files in git and the service breaks, because the fix only ever existed inside the tool’s own database. The GUI has quietly become the source of truth and nobody told your repository.
Every decision below comes back to that: does the tool edit the file on disk, or does it keep a private copy?
Dockge: a UI over files that still exist
Dockge, from the author of Uptime Kuma, does one thing: it manages compose stacks in a directory. Every stack is a normal folder containing a normal compose.yaml. Edit it in the browser, edit it in vim, edit it in both — it is the same file.
services:
dockge:
image: louislam/dockge:1
restart: unless-stopped
ports:
- "5001:5001"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./data:/app/data
- /opt/stacks:/opt/stacks
environment:
- DOCKGE_STACKS_DIR=/opt/stacks
Point /opt/stacks at a git repository and drift becomes impossible to hide: git status shows exactly what the GUI changed.
cd /opt/stacks && git init
printf '*/data/\n.env\n' > .gitignore
git add -A && git commit -m "Baseline stacks"
What Dockge does not do: image management, volume browsing, registries, users and teams, or remote hosts. It is a compose front end, deliberately. Everything else stays where it was, so nothing you already know about docker compose becomes obsolete the moment you install it.
The interactive terminal is the feature I use most. Pulling new images, watching a stack come up and reading the failure in the same pane beats three SSH windows, and the output is the real compose output rather than a summary of it.
Portainer: the full console
Portainer manages containers, images, networks, volumes, secrets, multiple endpoints and Kubernetes clusters — including a k3s cluster on a Pi 5 — behind role-based access control.
services:
portainer:
image: portainer/portainer-ce:2.27.4
restart: unless-stopped
ports:
- "9443:9443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./data:/data
The catch is Portainer’s “stacks”. A stack created in the web editor is stored in Portainer’s own database and deployed from there. Your host has no compose file to read, back up or commit. Two ways out:
- Deploy stacks from a git repository — Portainer pulls the compose file, and the repo stays authoritative. This is the correct answer.
- Keep deploying with
docker composeon the CLI and treat Portainer as read-only for inspecting and restarting. Portainer shows externally-created stacks as “limited”, which is exactly the boundary you want.
Both of them want the Docker socket
Handing a container /var/run/docker.sock is handing it root on the host. Anything that can talk to the socket can start a privileged container mounting /. Treat these UIs as administrative tools, not public services:
- Never publish the port to the internet. Reach it over VPN, a tunnel, or your LAN only.
- Bind to the LAN interface explicitly:
- "192.168.1.20:9443:9443". - Put authentication in front of it at the proxy as well as in the app.
- For anything that only needs to read state, a socket proxy that whitelists specific API paths limits the damage considerably.
It is worth saying plainly because the convenience hides it: a compromised web UI on a Docker host is not a compromised app, it is a compromised machine. Neither tool is doing anything unusual here, but both deserve to be treated like a root shell with a login page.
What I run
Dockge, on a single host, with /opt/stacks in git. It gives me the ninety per cent I actually want — start, stop, update, read logs, edit a variable — without ever becoming a second source of truth. The compose files stay the artefacts; the UI is just a convenient window onto them.
Portainer earns its place when there is more than one host, more than one person, or Kubernetes in the mix. If you go that way, deploy stacks from git from the very first one. Portainer vs Dockge is less about features than about which tool makes it harder to lose track of what your server is actually running, and a tool you can audit with git diff is worth a lot of dashboard polish.

Leave a Reply
You must be logged in to post a comment.