Dockge: Manage Docker Compose Stacks Visually
Docker Compose has become the go‑to tool for defining and running multi‑container Docker applications. Yet, when you start juggling several stacks, the YAML files can feel like a maze. That’s where Dockge steps in – a lightweight web UI that lets you spin up, monitor, and manage Docker Compose stacks without leaving your browser.
In this article we’ll walk through Dockge’s core features, set it up from scratch, and explore three practical scenarios: a development environment, a CI/CD pipeline, and a self‑hosted media server. By the end you’ll know how to turn a handful of docker‑compose.yml files into a clean, visual dashboard that anyone on your team can use.
Getting Started: Installing Dockge
Dockge is distributed as a single Docker image, which means you can launch it on any host that already runs Docker. The installation process is essentially three steps: pull the image, create a persistent volume for configuration, and run the container.
docker pull lkhont/dockge:latest
docker volume create dockge-data
docker run -d \
--name dockge \
-p 5001:5001 \
-v dockge-data:/app/data \
-v /var/run/docker.sock:/var/run/docker.sock \
lkhont/dockge:latest
Notice the bind‑mount of /var/run/docker.sock. This gives Dockge direct access to the Docker daemon, enabling it to create, start, and stop containers on your behalf. The dockge-data volume stores stack definitions, user settings, and UI preferences, so a container restart never wipes your work.
First‑time login
Open http://<host_ip>:5001 in your browser. The default credentials are admin / admin. For security, Dockge forces you to change the password on first login. Head to the “Settings” gear icon → “Change Password” and pick something strong.
Understanding the Dashboard
The Dockge UI is split into three panes: the left navigation bar, the central stack list, and a details pane that slides in when you click a stack. Each stack corresponds to a folder containing a docker-compose.yml file and optional environment files.
- Stack Overview: Shows the status of each service (running, stopped, error) with colored badges.
- Logs & Stats: Click a service to view real‑time logs or resource usage charts powered by the Docker API.
- Actions: Start, stop, restart, pull images, or open a terminal directly from the UI.
Because Dockge reads the compose file on the fly, you can edit the YAML in your favorite editor, hit “Refresh” in the UI, and see the changes instantly. No need to re‑import the stack.
Managing Secrets and Environment Variables
Dockge supports Docker secrets and environment files out of the box. Simply place a .env file next to your docker-compose.yml and reference it with env_file: .env. For secrets, create a file under a secrets/ subdirectory and reference it in the compose file; Dockge will mask the values in the UI.
services:
db:
image: postgres:15
env_file: .env
secrets:
- db_password
secrets:
db_password:
file: ./secrets/db_password.txt
This keeps sensitive data out of version control while still giving developers a clear visual cue that a secret is attached to a service.
Practical Example 1: Local Development Stack
Imagine you’re building a Node.js API backed by PostgreSQL and Redis. You normally spin up three containers with docker compose up -d, but you also want to toggle the Redis cache on and off while debugging. Dockge makes this a click‑away operation.
First, create a directory my‑app with the following files:
# my-app/docker-compose.yml
version: "3.9"
services:
api:
image: node:20-alpine
working_dir: /app
volumes:
- ./:/app
command: npm run dev
ports:
- "3000:3000"
depends_on:
- db
db:
image: postgres:15
environment:
POSTGRES_USER: dev
POSTGRES_PASSWORD: dev
POSTGRES_DB: myapp
ports:
- "5432:5432"
redis:
image: redis:7-alpine
ports:
- "6379:6379"
Now add the folder to Dockge:
- In the UI, click “Add Stack”.
- Give it a name like “MyApp‑Dev”.
- Browse to the
my‑appfolder on the host (Dockge will store the absolute path). - Hit “Create”.
Dockge will parse the compose file and list three services. You can start the whole stack with a single “Start All” button, or stop just Redis while keeping the API and DB alive. The UI also shows live logs, so you can watch npm run dev output without opening a separate terminal.
Pro tip: Use Dockge’s “Clone Stack” feature to create a duplicate of your dev environment for feature‑branch testing. The cloned stack inherits the same compose file but runs on a separate set of containers, keeping your main dev stack untouched.
Practical Example 2: CI/CD Pipeline Dashboard
In many teams, the CI server (e.g., Jenkins, GitLab Runner) builds Docker images and then deploys them via Docker Compose. Keeping track of which version is running on which environment can be error‑prone. Dockge can act as a single source of truth for staging and production stacks.
Suppose you have two stacks: staging and production. Each resides in its own folder with a docker-compose.yml that references images tagged with the Git commit SHA.
# stacks/staging/docker-compose.yml
version: "3.9"
services:
web:
image: registry.example.com/myapp:${COMMIT_SHA}
ports:
- "8080:80"
environment:
- ENV=staging
When your CI pipeline finishes a build, it can automatically update the COMMIT_SHA environment variable in the stack’s .env file and trigger a “Pull & Restart” from Dockge’s API.
# CI snippet (bash)
COMMIT_SHA=$(git rev-parse --short HEAD)
echo "COMMIT_SHA=$COMMIT_SHA" > /opt/stacks/staging/.env
curl -X POST http://dockge:5001/api/stacks/staging/pull_and_restart \
-H "Authorization: Bearer $DOCKGE_TOKEN"
The /api/stacks/:name/pull_and_restart endpoint is a convenient shortcut that pulls the latest images and restarts the stack in one atomic operation. Dockge’s UI instantly reflects the new image tag, and you can click a service to view the updated logs.
Pro tip: Enable Dockge’s “Webhooks” feature (Settings → Webhooks) to receive a POST request whenever a stack changes state. Hook this into Slack or Microsoft Teams to get real‑time deployment notifications.
Practical Example 3: Self‑Hosted Media Server
Many hobbyists run Plex, Jellyfin, or Emby alongside supporting services like a reverse proxy (Traefik) and a downloader (qBittorrent). Managing these containers manually can become cumbersome, especially when you want to tweak network settings or add new media folders.
Below is a compact Docker Compose file that brings together Traefik, Jellyfin, and qBittorrent. Dockge will let you toggle each component, view resource usage, and even edit the compose file directly from the UI.
# media-stack/docker-compose.yml
version: "3.9"
services:
traefik:
image: traefik:v2.10
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
jellyfin:
image: jellyfin/jellyfin:latest
environment:
- TZ=Europe/London
volumes:
- ./jellyfin/config:/config
- ./media:/media
labels:
- "traefik.enable=true"
- "traefik.http.routers.jellyfin.rule=Host(`jellyfin.local`)"
- "traefik.http.services.jellyfin.loadbalancer.server.port=8096"
restart: unless-stopped
qbittorrent:
image: linuxserver/qbittorrent:latest
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
volumes:
- ./qbittorrent/config:/config
- ./downloads:/downloads
labels:
- "traefik.enable=true"
- "traefik.http.routers.qbittorrent.rule=Host(`qbittorrent.local`)"
- "traefik.http.services.qbittorrent.loadbalancer.server.port=8080"
restart: unless-stopped
After adding the media‑stack folder to Dockge, you can start the entire suite with one click, or stop Traefik while you’re troubleshooting network issues. The UI’s “Stats” tab shows CPU and memory consumption per service, helping you spot a memory‑hungry torrent client before it crashes your NAS.
Pro tip: Enable “Auto‑Refresh” (top‑right toggle) so Dockge polls the Docker daemon every few seconds. This is especially handy for media stacks where downloads can cause rapid container restarts.
Advanced Features: Custom Themes and Access Control
Dockge ships with a clean, dark‑mode default theme, but you can override the CSS by mounting a custom theme.css into /app/public. For organizations that need role‑based access, Dockge supports local users and LDAP integration.
- Local Users: Add users via Settings → Users. Assign each user a “Read‑Only” or “Admin” role.
- LDAP: Provide your LDAP URL, bind DN, and search base. Dockge will authenticate against the directory and map groups to Dockge roles.
These features make Dockge suitable for both solo developers and larger teams that want a shared “Docker Dashboard” without exposing the Docker socket to every user’s machine.
Backup and Migration Strategies
Since Dockge stores all stack definitions in a Docker volume, backing up is as simple as exporting the volume. Use docker run --rm -v dockge-data:/data -v $(pwd):/backup alpine tar czf /backup/dockge-backup.tar.gz -C /data . to create a compressed archive.
To restore on a new host, create the volume, copy the archive into it, and extract:
docker volume create dockge-data
docker run --rm -v dockge-data:/data -v $(pwd):/backup alpine \
sh -c "cd /data && tar xzf /backup/dockge-backup.tar.gz"
After restoring, spin up the Dockge container as before. All your stacks will reappear exactly where you left them, making migrations painless.
Performance Considerations
Dockge’s resource footprint is modest – typically under 50 MB RAM and a few CPU cycles when idle. However, the UI does poll the Docker daemon for container stats. If you run Dockge on a low‑end Raspberry Pi, consider increasing the poll interval in Settings → Advanced → “Stats Refresh Rate”.
For large installations (hundreds of services), enable “Lazy Loading” which only fetches logs and stats for the currently selected stack, reducing API chatter.
Security Best Practices
Because Dockge talks directly to the Docker socket, securing the UI is paramount. Follow these guidelines:
- HTTPS: Run Dockge behind a reverse proxy (Traefik, Nginx) with TLS termination.
- Network Isolation: Deploy Dockge on a dedicated management network, separate from production workloads.
- Least‑Privileged Users: Grant “Read‑Only” access to developers who only need to view logs, reserving “Admin” rights for ops staff.
- API Tokens: Use long, random tokens for API access and rotate them quarterly.
Adhering to these practices ensures that a compromised UI does not become a gateway to your entire Docker host.
Extending Dockge with Custom Scripts
Dockge supports “Hooks” – custom shell scripts that run before or after stack actions (start, stop, restart). Place a hooks/ folder inside a stack directory and add scripts named pre_start.sh, post_stop.sh, etc.
# stacks/my‑app/hooks/pre_start.sh
#!/bin/bash
# Ensure the latest code is pulled before containers start
git -C /opt/my-app pull origin main
Make the script executable (chmod +x) and Dockge will automatically execute it whenever you click “Start”. This is a powerful way to embed CI steps directly into your deployment workflow.
Pro tip: Combine hooks with environment variable substitution to pass dynamic values (like the current Git branch) into your compose file without manual edits.
Conclusion
Dockge transforms Docker Compose from a command‑line‑only experience into an intuitive visual workflow. By centralizing stack definitions, exposing real‑time logs, and providing granular control over each service, it bridges the gap between developers, ops, and non‑technical stakeholders. Whether you’re running a simple dev stack, orchestrating CI/CD deployments, or hosting a full‑blown media server, Dockge’s lightweight design and extensibility make it a valuable addition to any Docker‑centric toolkit.