Docker Compose for Your Home Lab: Run a Whole Stack from One File, Done Right (Linux, Windows, Mac)
Before you start
- 24 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#
Docker Compose is the free, open-source tool that starts a whole group of containers (an app, its database, a proxy) from one text file with one command, docker compose up -d, and keeps their networks, settings and data together so you can start, check, update and stop them as one stack.

Logo: the official Docker Compose project (github.com/docker/compose, file logo.png), Apache-2.0. The octopus is a Docker mark, shown here only to identify the tool.
We use one Miniflux and Postgres stack to learn secrets, healthchecks, profiles, include, HTTPS and safe updates. The same Compose file works on Linux, Windows and Mac.
| What | Value (official sources, read 5 December 2026) |
|---|---|
| Current version | Docker Compose v5.8.1, released 27 November 2026 (previous: v5.8.0, 17 November) |
| Why "v5" | Docker skipped 3 and 4 to avoid confusion with the old file versions 2.x and 3.x (5.0.0 notes). Same docker compose command as "Compose v2". |
| Licence | Apache-2.0 (GitHub repository) |
| Example stack | miniflux/miniflux:2.3.6 (29 November 2026) and postgres:18.7 (26 November 2026), both tags checked on Docker Hub |
| Time needed | About 60 minutes (our estimate, not measured) |
| Ports | None of its own. Our example publishes 127.0.0.1:8080 only |
| RAM | Compose is a command; the containers use the RAM (see Performance) |
| Official docs | docs.docker.com/compose |
At a glance:
- The command:
docker composewith a space. The hyphen versiondocker-composeis the old Python v1, end of life since 2022 (a maintainer, issue 12068). - The file:
compose.yamlis the preferred name. Never add aversion:line: Compose ignores it and warns. - Three habits that prevent most trouble: pin image tags, check the file with
docker compose configbefore you start, and use--waitwith healthchecks. - Not covered: Swarm, Kubernetes, Compose Watch (a developer feature).
- Pair it with: Traefik or Caddy for HTTPS, docker-volume-backup for scheduled backups, Diun or dockcheck to learn about updates.
How it fits together#
You describe services, networks and storage in compose.yaml, keep passwords in .env, and docker compose up -d --wait creates the database first, waits until it is healthy, then starts the app; a reverse proxy in front adds HTTPS.
Drawn for this guide from the official docs. All names and values are dummies.
Four words: a service is one kind of container in your file (miniflux, db); a project is the whole stack; a bind mount shows a host folder inside a container (./db); a healthcheck is a command Docker runs inside a container to see whether it really works.
Before you start#
Note: every password, domain and name on this page is a dummy example (
change-me-...,example.com). Replace each with your own and keep real secrets out of Git.
| System | What to have |
|---|---|
| Linux | Docker Engine and the docker-compose-plugin package from Docker's repository |
| Windows | Windows 10 or later, Docker Desktop (it includes Compose), PowerShell |
| Mac | Docker Desktop (it includes Compose), Intel or Apple Silicon |
docker --version docker compose version
Checklist:
- [ ]
docker compose versionprints a version - [ ] Port 8080 is free (or pick another number in Step 2)
- [ ] Only for the HTTPS part: a domain pointing to your server, and ports 80 and 443 reachable
Tested by DIY Lab Hub: not yet. Commands come from the official docs and the sources named at the end, read on 5 December 2026. We did not run them on a real machine.
Tip: Docker Desktop's Compose may differ from the newest GitHub release. Trust
docker compose versionon your machine.
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, Docker, reverse proxy, HTTPS), 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 learning Docker Compose by installing a small stack: the feed reader Miniflux with its Postgres database, written as one compose.yaml.
Follow the DIY Lab Hub guide https://diylabhub.com/docker-compose/ (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 a firewall or router, or opens a port.
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 runs it: Linux (which distribution), Windows or Mac? Windows and Mac use Docker Desktop, which includes Compose.
2. Are Docker and Compose installed? Check: docker --version and docker compose version (the command is "docker compose" with a space, not the old "docker-compose").
3. Is port 8080 free?
4. Do I run it only on this computer, or on a server with a domain? If a server: do I already run a reverse proxy: Traefik, Caddy, nginx / Nginx Proxy Manager, or none?
5. HTTPS wanted: public domain, home only, or plain HTTP on localhost?
THEN FOLLOW THE MATCHING PATH:
- Docker or Compose missing: Linux = Docker Engine + the docker-compose-plugin package from Docker's repository; Windows/Mac = Docker Desktop (docs.docker.com).
- localhost only: use the files below as they are (Miniflux is published on 127.0.0.1:8080 only).
- Traefik already running (entrypoint "https", resolver "le", external network "proxy"): create the network once (docker network create proxy), set MINIFLUX_HOST=<my-host> and MINIFLUX_BASE_URL=https://<my-host> in .env, delete the ports lines of the miniflux service, and add to it (never attach db to proxy):
networks: [default, proxy]
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.routers.miniflux.rule=Host(`${MINIFLUX_HOST}`)"
- "traefik.http.routers.miniflux.entrypoints=https"
- "traefik.http.routers.miniflux.tls=true"
- "traefik.http.routers.miniflux.tls.certresolver=le"
- "traefik.http.services.miniflux.loadbalancer.server.port=8080"
plus a top-level "networks: proxy: external: true".
- No proxy yet but I want HTTPS: Caddy as in the guide's HTTPS section. Add only the networks part (no labels) to miniflux. Caddyfile for a public domain: "rss.example.com { reverse_proxy miniflux:8080 }" with automatic Let's Encrypt (DNS record to the server, ports 80 and 443 open). Home only: "tls internal" inside the block, then trust Caddy's root certificate on my devices. If Caddy runs directly on the host instead of in Docker: keep the ports line and use reverse_proxy 127.0.0.1:8080.
- nginx / Nginx Proxy Manager: proxy only container port 8080 and set MINIFLUX_BASE_URL to the public address.
THE FILES (folder ~/docker_volumes/miniflux; Windows: $HOME\docker_volumes\miniflux):
Linux/Mac: mkdir -p ~/docker_volumes/miniflux/{db,backups} && cd ~/docker_volumes/miniflux
.env (chmod 600; make both passwords on my machine with: openssl rand -hex 24 ; Windows PowerShell: 24 random bytes from [Security.Cryptography.RandomNumberGenerator] written as hex; letters and digits only because the database password goes into a web address; add .env to .gitignore):
MINIFLUX_TAG=2.3.6
POSTGRES_PASSWORD=<generated-db-password>
MINIFLUX_ADMIN_USER=admin
MINIFLUX_ADMIN_PASSWORD=<generated-admin-password>
MINIFLUX_BASE_URL=http://localhost:8080
compose.yaml (keep these exact versions):
name: miniflux
services:
miniflux:
image: miniflux/miniflux:${MINIFLUX_TAG:?Set MINIFLUX_TAG in .env}
restart: unless-stopped
depends_on:
db:
condition: service_healthy
ports:
- "127.0.0.1:8080:8080"
environment:
DATABASE_URL: postgres://miniflux:${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}@db/miniflux?sslmode=disable
RUN_MIGRATIONS: "1"
CREATE_ADMIN: "1"
ADMIN_USERNAME: ${MINIFLUX_ADMIN_USER:-admin}
ADMIN_PASSWORD: ${MINIFLUX_ADMIN_PASSWORD:?Set MINIFLUX_ADMIN_PASSWORD in .env}
BASE_URL: ${MINIFLUX_BASE_URL:-http://localhost:8080}
healthcheck:
test: ["CMD", "/usr/bin/miniflux", "-healthcheck", "auto"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
db:
image: postgres:18.7
restart: unless-stopped
environment:
POSTGRES_USER: miniflux
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}
POSTGRES_DB: miniflux
volumes:
- ./db:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
Postgres 18 mounts at /var/lib/postgresql (Postgres 17 and older used /var/lib/postgresql/data). Check the file: docker compose config -q
Start it: docker compose up -d --wait then: docker compose ps and docker compose logs --tail=50 miniflux
CHECK IT WORKED:
- docker compose ps lists db and miniflux with a status containing "healthy".
- http://localhost:8080 shows the Miniflux login page; I sign in with the admin name and password from .env.
- After the first start, delete CREATE_ADMIN, ADMIN_USERNAME and ADMIN_PASSWORD from the miniflux service (and the two admin lines from .env), then docker compose config -q && docker compose up -d --wait.
- With HTTPS: curl -I https://<my-host> returns a status line and no certificate warning (Windows: curl.exe). After changing MINIFLUX_BASE_URL run docker compose up -d.
- Safe update later: dump the database first, change only MINIFLUX_TAG in .env after reading the Miniflux release notes, then docker compose config --images, docker compose pull, docker compose up -d --wait. Never swap the Postgres major version (18 to 19) by changing a tag over old data: that needs a dump and a restore.
RULES FOR YOU:
- Use only the versions and settings above. Do not use :latest and do not invent options; on an error show me the exact text and check https://docs.docker.com/compose/ before guessing.
- Never publish port 8080 to the internet without HTTPS. Keep passwords in .env only.
- Values like rss.example.com and <my-host> are examples; ask me for mine.
- Never ask me to paste passwords, tokens or keys into this chat.
Step 1: Create the folders and the .env file#
Everything lives under ~/docker_volumes/miniflux. Compose reads the .env file next to compose.yaml to fill in ${NAME} placeholders (interpolation). It does not put those values into your containers unless the Compose file passes them on.
Linux#
mkdir -p ~/docker_volumes/miniflux/{db,backups}
cd ~/docker_volumes/miniflux
cat > .env << 'EOF'
MINIFLUX_TAG=2.3.6
POSTGRES_PASSWORD=change-me-db-password
MINIFLUX_ADMIN_USER=admin
MINIFLUX_ADMIN_PASSWORD=change-me-admin-password
MINIFLUX_BASE_URL=http://localhost:8080
EOF
chmod 600 .env
These are dummy values: replace both passwords with long random ones, for example from openssl rand -hex 24 (letters and digits only: the database password goes into a web address).
Windows (PowerShell)#
$base = "$HOME\docker_volumes\miniflux"
foreach ($d in "db","backups") {
New-Item -ItemType Directory -Force "$base\$d" | Out-Null
}
Set-Location $base
@'
MINIFLUX_TAG=2.3.6
POSTGRES_PASSWORD=change-me-db-password
MINIFLUX_ADMIN_USER=admin
MINIFLUX_ADMIN_PASSWORD=change-me-admin-password
MINIFLUX_BASE_URL=http://localhost:8080
'@ | Set-Content -Encoding ascii .env
Same dummy values. A random password in PowerShell: $b = New-Object byte[] 24; [Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($b); -join ($b | ForEach-Object { $_.ToString('x2') }).
Mac (Terminal)#
Same commands as Linux (openssl is included in macOS).
Check it worked. ls -la (Windows: Get-ChildItem -Force) shows .env, db and backups.
Tip: Add
.envto.gitignorethe day you create the stack. A password pushed to Git once is leaked, even if you delete it later.
Step 2: Write the Compose file#
We keep postgres:18.7: Miniflux 2.3.6 still uses PostgreSQL 18 in its official Compose file, checked 5 December 2026.
Linux#
cd ~/docker_volumes/miniflux
cat > compose.yaml << 'EOF'
name: miniflux
services:
miniflux:
image: miniflux/miniflux:${MINIFLUX_TAG:?Set MINIFLUX_TAG in .env}
restart: unless-stopped
depends_on:
db:
condition: service_healthy
ports:
- "127.0.0.1:8080:8080"
environment:
DATABASE_URL: postgres://miniflux:${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}@db/miniflux?sslmode=disable
RUN_MIGRATIONS: "1"
CREATE_ADMIN: "1"
ADMIN_USERNAME: ${MINIFLUX_ADMIN_USER:-admin}
ADMIN_PASSWORD: ${MINIFLUX_ADMIN_PASSWORD:?Set MINIFLUX_ADMIN_PASSWORD in .env}
BASE_URL: ${MINIFLUX_BASE_URL:-http://localhost:8080}
healthcheck:
test: ["CMD", "/usr/bin/miniflux", "-healthcheck", "auto"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
db:
image: postgres:18.7
restart: unless-stopped
environment:
POSTGRES_USER: miniflux
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}
POSTGRES_DB: miniflux
volumes:
- ./db:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
EOF
Windows (PowerShell)#
Set-Location "$HOME\docker_volumes\miniflux"
@'
name: miniflux
services:
miniflux:
image: miniflux/miniflux:${MINIFLUX_TAG:?Set MINIFLUX_TAG in .env}
restart: unless-stopped
depends_on:
db:
condition: service_healthy
ports:
- "127.0.0.1:8080:8080"
environment:
DATABASE_URL: postgres://miniflux:${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}@db/miniflux?sslmode=disable
RUN_MIGRATIONS: "1"
CREATE_ADMIN: "1"
ADMIN_USERNAME: ${MINIFLUX_ADMIN_USER:-admin}
ADMIN_PASSWORD: ${MINIFLUX_ADMIN_PASSWORD:?Set MINIFLUX_ADMIN_PASSWORD in .env}
BASE_URL: ${MINIFLUX_BASE_URL:-http://localhost:8080}
healthcheck:
test: ["CMD", "/usr/bin/miniflux", "-healthcheck", "auto"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
db:
image: postgres:18.7
restart: unless-stopped
environment:
POSTGRES_USER: miniflux
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}
POSTGRES_DB: miniflux
volumes:
- ./db:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
'@ | Set-Content -Encoding ascii compose.yaml
Mac (Terminal)#
Same commands as Linux.
The stack follows the Miniflux Docker page and its Compose examples at tag 2.3.6. We changed three things: pinned tags instead of latest, passwords from .env instead of secret and test123, and the port bound to 127.0.0.1. The lines worth understanding:
| Line | Why |
|---|---|
No version: line | Obsolete. Compose validates against the newest specification and only warns. |
name: miniflux | The project name (default: the folder name). |
${MINIFLUX_TAG:?...} | :? stops with your message if the variable is unset or empty. |
${MINIFLUX_ADMIN_USER:-admin} | :- uses admin if the variable is unset or empty. |
$${POSTGRES_USER} | $$ is a literal $: the shell inside the container reads its own variable. |
depends_on with service_healthy | miniflux is created only after the db healthcheck passes. The short form (- db) waits only for "started". |
start_period: 30s | Failed checks in the first 30 seconds do not count. |
| Miniflux healthcheck | The image has none built in (Dockerfile at 2.3.6); this is the command from the Miniflux docs. |
./db:/var/lib/postgresql | Postgres 18 mounts here. Postgres 17 and older used /var/lib/postgresql/data. |
127.0.0.1:8080:8080 | Only this machine reaches port 8080. A plain 8080:8080 opens it to your whole network. |
RUN_MIGRATIONS, CREATE_ADMIN | Miniflux builds its tables and the first admin user at start. |
Check it worked. In the project folder run:
docker compose config -q docker compose config --services docker compose config --images
config -q prints nothing when the file is valid (or your Set ... in .env message if a value is missing). --services lists db and miniflux; --images lists the two images with your pinned tags. We did not run it. For the shape of real output, the docs show docker compose config turning image: "webapp:${TAG}" into image: 'webapp:v1.5' when .env says TAG=v1.5.
Tip: Plain
docker compose configprints every password. Never paste it into a forum or chat.
Step 3: Start the stack and wait until it is healthy#
Linux#
cd ~/docker_volumes/miniflux docker compose up -d --wait docker compose ps docker compose logs --tail=50 miniflux
Windows (PowerShell)#
Set-Location "$HOME\docker_volumes\miniflux" docker compose up -d --wait docker compose ps docker compose logs --tail=50 miniflux
Mac (Terminal)#
Same commands as Linux.
up -d creates the network and containers in the background; --wait returns only when the services are running or healthy, which is what our healthchecks are for. The first run pulls two images. We did not run this, so we show no output; docker compose ps should list db and miniflux with a status containing healthy.
Check it worked. Open http://localhost:8080. The Miniflux login page appears. Sign in with the admin name and password from .env.
Step 4: Remove what you only needed once#
The Miniflux docs say the CREATE_ADMIN, ADMIN_USERNAME and ADMIN_PASSWORD lines can go after the first start. Delete those three lines from the miniflux service in compose.yaml (you can then also delete the two admin lines from .env), then apply:
Linux#
cd ~/docker_volumes/miniflux docker compose config -q docker compose up -d --wait
Windows (PowerShell)#
Set-Location "$HOME\docker_volumes\miniflux" docker compose config -q docker compose up -d --wait
Mac (Terminal)#
Same commands as Linux.
Check it worked. Both services are still listed and you can still sign in. Compose recreated only miniflux: only its configuration changed.
Tip: Editing
compose.yamlor.envchanges nothing in a running container. Onlydocker compose up -dapplies it.
Step 5: Add an optional job with a profile#
A profile marks a service as optional: a normal up skips it. We use one for a database backup job. Add this under services::
db-dump:
image: postgres:18.7
profiles: ["tools"]
depends_on:
db:
condition: service_healthy
environment:
PGPASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}
volumes:
- ./backups:/backups
command: ["sh", "-c", "pg_dump -h db -U miniflux -Fc -f /backups/miniflux-$$(date +%F).dump miniflux"]
The same image tag as the database means a matching pg_dump. $$(date +%F) is evaluated inside the container (today's date). Run it on demand:
Linux#
cd ~/docker_volumes/miniflux docker compose config --profiles docker compose run --rm db-dump ls -l backups
Windows (PowerShell)#
Set-Location "$HOME\docker_volumes\miniflux" docker compose config --profiles docker compose run --rm db-dump Get-ChildItem backups
Mac (Terminal)#
Same commands as Linux.
Naming a profiled service on the command line runs it without enabling the profile (profiles docs). A plain up -d never starts it; docker compose --profile "*" up -d starts every profile.
Check it worked. config --profiles prints tools, and backups holds a miniflux-<date>.dump file (owned by root on Linux).
Tip: Never put something your app needs behind a profile. The docs say a profiled service's dependencies must share its profile, be started separately, or have no profile.
Step 6: Split a growing setup with include#
When one file grows long, give each stack its own folder and add a small parent file with include. Each included file keeps its own folder for relative paths and its own .env for defaults. Parent file ~/docker_volumes/compose.yaml:
include: - ./miniflux/compose.yaml - ./<your-other-stack>/compose.yaml
Linux#
cd ~/docker_volumes docker compose config --services
Windows (PowerShell)#
Set-Location "$HOME\docker_volumes" docker compose config --services
Mac (Terminal)#
Same commands as Linux.
Included resources are copied in, never merged, so two stacks must not reuse a service or network name (include differs from -f base.yaml -f override.yaml, which merges). Check it worked: the list holds the services of both stacks. This step is optional.
Tip: Compose isolates stacks by project name, so starting
minifluxfrom its own folder and again through the parent file may create a second project and clash on port 8080. Rundocker compose downin the stack folder first (your data stays in./db) and use one way to start it. We did not test this; it follows from the project-name docs.
Put it behind HTTPS (with or without Traefik)#
This is for a server with a domain name; at home on localhost skip it. Both routes need Miniflux on a shared network named proxy, and MINIFLUX_BASE_URL in .env must be the public address:
MINIFLUX_HOST=rss.example.com MINIFLUX_BASE_URL=https://rss.example.com
(rss.example.com is a dummy: use your own.) Create the shared network once (same in PowerShell):
docker network create proxy
Never attach db to proxy: every stack on it shares one name space. Only the web service joins.
With Traefik#
Our Traefik guide sets up Traefik with entrypoints http and https, certificate resolver le and network proxy. Add this to the miniflux service (and delete its ports: lines) plus the network block at the bottom:
services:
miniflux:
networks:
- default
- proxy
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.routers.miniflux.rule=Host(`${MINIFLUX_HOST}`)"
- "traefik.http.routers.miniflux.entrypoints=https"
- "traefik.http.routers.miniflux.tls=true"
- "traefik.http.routers.miniflux.tls.certresolver=le"
- "traefik.http.services.miniflux.loadbalancer.server.port=8080"
networks:
proxy:
external: true
traefik.docker.network picks the network Traefik uses (Traefik docs); default keeps the database reachable. Then docker compose config -q and docker compose up -d --wait. The official Miniflux Traefik example uses the same labels with its own entrypoint and resolver names.
Without Traefik: Caddy#
Add only the networks part (no labels) to miniflux and run Caddy as in our Caddy guide. In its Caddyfile, for a public domain (Caddy gets a Let's Encrypt certificate by itself; ports 80 and 443 must reach it):
rss.example.com {
reverse_proxy miniflux:8080
}
At home, with a name only your network knows, tls internal lets Caddy sign its own certificate; trust its root on your devices (the Caddy guide shows Linux, Windows and Mac):
rss.home.arpa {
tls internal
reverse_proxy miniflux:8080
}
If Caddy runs directly on the host instead of in Docker, keep the ports line and use reverse_proxy 127.0.0.1:8080.
Check it worked. curl -I https://rss.example.com returns a status line and no certificate warning (with tls internal, trust the root first).
Tip: After changing
MINIFLUX_BASE_URL, rundocker compose up -d: Miniflux builds its links from it.
Security and testing#
| Control | How |
|---|---|
| Published ports | Bind to 127.0.0.1 unless another machine must connect. Docker's docs warn that published ports bypass ufw rules. |
| Secrets | In .env (Linux and Mac: chmod 600), out of Git. Do not put them in compose.yaml. |
| What leaks | docker compose config and docker inspect show variable values: treat both as secret. |
| Database | No ports: on db. The app reaches it by name on the project network. |
| Docker socket | Only Traefik needs it; see our socket proxy guide. |
| Images | Pinned tags; scan with Trivy; lint your own Dockerfiles with Hadolint. |
Quick tests:
docker compose ps docker compose logs --tail=100 docker compose exec db pg_isready -U miniflux curl -I http://localhost:8080/healthcheck
Common mistakes#
The messages are quoted from the linked GitHub issues, which we read for this guide. Old reports show the pattern, not proof that a bug still exists.
| Mistake | Why it happens | Do this instead |
|---|---|---|
no configuration file provided: not found (compose #14429) | You ran Compose outside the stack folder. -p <name> names a project; it does not find its file. | cd into the folder, or use -f /full/path/compose.yaml |
Invalid interpolation format for "command" option in service "node-exporter" (compose #4485) | An unescaped $. Compose reads it as the start of a variable. | Write $$. The same goes for password hashes in Traefik labels (Traefik docs). |
not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? (compose #11935) | The bind-mounted file did not exist, so Docker made a folder of that name (default Engine behaviour, a maintainer says). | Create the file first, or mount its folder, then down and up -d. |
container for service "mysql" is unhealthy (compose #9367) | A healthcheck with 3 retries at 1 second: the database was not ready in time (the maintainer). | Use start_period, interval: 10s, retries: 5. |
error mounting ... to rootfs at "/var/lib/postgresql/data": ... no such file or directory (postgres #1370) | Postgres 18 moved the volume to /var/lib/postgresql. Older guides mount .../data. | Mount /var/lib/postgresql for 18 and newer; keep /data for 17 and older. |
FATAL: data directory "/var/lib/postgresql/data" has wrong ownership on Windows (postgres #435) | A 2018 report: a bind mount on the Windows disk did not keep Linux owners (the maintainer blamed Docker for Windows). | A user there switched to a named volume (db_data:/var/lib/postgresql plus a top-level volumes: db_data:). Not tested by us on current Docker Desktop. |
the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion (compose #12068) | A line copied from an old tutorial; obsolete since the Compose Specification in 2020 (a maintainer). | Delete the version: line. It is only a warning. |
required variable NPM_DB_ROOT_PASSWORD is missing a value: error message (compose #10293) | The ${VAR:?message} guard worked: the value was missing (that v2.16.0 report also had a misleading extra line). | Put the value in .env beside compose.yaml. Keep the guard. |
| The app starts before the database accepts connections | depends_on: [db] waits for "started", not "ready". Even service_healthy applies only at start; later failures are yours to handle (compose #11582, a maintainer). | Use condition: service_healthy and an app that retries its connection. |
Bind for 0.0.0.0:50052 failed: port is already allocated (compose #11158) | Two things want the same host port (there, extends merged the port lists). | Check the merged ports with docker compose config, then change one host port. |
Running docker compose down -v to "clean up" before an update | -v also removes the named volumes declared in the file. | Plain docker compose down keeps them. Do not make -v a habit. |
AI assistants: "add version: "3.9" to use condition: service_healthy" | Mixed up with the old file versions. Compose ignores the line. | Use long-form depends_on and a real healthcheck. No version:. |
AI assistants: docker-compose up -d (hyphen) | Old training data from the Python v1 era. | Use docker compose up -d. |
AI assistants: mounting Postgres at /var/lib/postgresql/data and tagging postgres:latest | An answer that was right for Postgres 17 and older. | Pin a tag and read the image's PGDATA note. For 18 mount /var/lib/postgresql. |
We did not measure how often assistants give these answers; the rows describe outdated answer shapes that match the issues above.
Tip: When Compose says "unhealthy" it prints only the container name. To see why:
docker inspect --format '{{json .State.Health}}' $(docker compose ps -q db). A feature request (14585, open) asks Compose to show it.
Tip: The Miniflux Docker page says "It is recommended to use a pinned version to avoid unexpected updates", though its example uses
latest. Pin the tag.
Troubleshooting#
| Problem | Solution |
|---|---|
| Which values does Compose use? | docker compose config --environment (secret!). Shell variables beat .env. |
| A service is missing | docker compose config --services, then check its profiles:. |
| Healthcheck fails | docker compose logs --tail=100 <service> and the docker inspect tip above. |
| Changes have no effect | docker compose up -d. |
docker: 'compose' is not a docker command | Install docker-compose-plugin (Linux) or Docker Desktop. |
| Leftover containers after renaming a service | docker compose up -d --remove-orphans. |
| Port 8080 busy | Change the left number in 127.0.0.1:8080:8080 and MINIFLUX_BASE_URL. |
Exact error texts#
required variable ... is missing a value: <your message>: our:?guard (form quoted in compose #10293). Add the value to.env.container for service "db" is unhealthy(form in compose #9367; #14585 says newer versions printcontainer <name> is unhealthy): a healthcheck failed. Read its log (tip above).- A warning that a variable is not set: the docs say Compose then uses an empty string. Add the value, or use
:?.
Known bugs (open, December 2026)#
Compose issue 14587, opened 4 December 2026: since v5.8.1 a reporter sees docker compose --project-name <name> restart, run from a folder of another project with a .env, silently do nothing; COMPOSE_DISABLE_ENV_FILE=1 restores the old behaviour. Maintainers have not confirmed it. Work from the stack's own folder and you will not meet it.
Updates and backups#
Update Compose itself. Linux: sudo apt-get update && sudo apt-get install docker-compose-plugin (a manually downloaded plugin does not update itself). Windows and Mac: update Docker Desktop. The v5.5.0 release (17 August 2026) says that after the upgrade, existing containers may be recreated the first time you run up, so update Compose when a short restart is fine.
The safe update flow for a stack. Read the release notes of the app first (Miniflux releases). Then:
Linux#
cd ~/docker_volumes/miniflux docker compose run --rm db-dump nano .env docker compose config --images docker compose pull docker compose up -d --wait docker compose ps docker compose logs --since=10m --tail=100 miniflux
Windows (PowerShell)#
Set-Location "$HOME\docker_volumes\miniflux" docker compose run --rm db-dump notepad .env docker compose config --images docker compose pull docker compose up -d --wait docker compose ps docker compose logs --since=10m --tail=100 miniflux
Mac (Terminal)#
Same commands as Linux.
In the editor change MINIFLUX_TAG. The order is the point: dump first, change one tag, check the image names, pull, recreate with --wait, then log in and open a feed. pull alone changes nothing that runs; up -d does the swap. Postgres minor updates use the same flow. For a major upgrade, wait for Miniflux's official example to adopt it, then dump and restore into a fresh data directory; never swap tags over old data (PostgreSQL 19 migration notes).
Roll back. Set the old tag and run docker compose up -d. If the new version already changed the database, the old one may not start on it; then restore the dump into a fresh ./db, as in the restore test below. We did not test a rollback.
Tools that help. Diun and dockcheck report new images without touching anything. docker rollout swaps one service without a gap, but needs no published ports, so it fits the Traefik variant.
Back up .env, compose.yaml and the dumps in backups/. Do not copy ./db while Postgres runs: a live copy may be inconsistent, which is why we dump. For encrypted copies see our docker-volume-backup guide. Save as ~/docker_volumes/miniflux/backup.sh:
#!/usr/bin/env bash set -euo pipefail cd "$HOME/docker_volumes/miniflux" docker compose run --rm db-dump tar -czf "backups/config-$(date +%F).tar.gz" .env compose.yaml chmod 600 backups/config-*.tar.gz
Run chmod 700 on it and add 0 3 * * * /home/<your-user>/docker_volumes/miniflux/backup.sh with crontab -e (Mac: /Users/<your-user>/...). On Windows put the same commands in backup.ps1 (Set-Location, docker compose run --rm db-dump, tar.exe -czf backups\config.tar.gz .env compose.yaml) and run it daily at 03:00 in Task Scheduler (powershell.exe -NoProfile -File <full-path>). Old dumps are not deleted: remove them yourself.
Restore test. A backup you never restored is a hope. Restore into a scratch database (replace the date):
docker compose exec db createdb -U miniflux restore_test docker compose run --rm db-dump pg_restore -h db -U miniflux -d restore_test /backups/miniflux-<date>.dump docker compose exec db psql -U miniflux -d restore_test -c "\dt" docker compose exec db dropdb -U miniflux restore_test
The same lines work in PowerShell and the Mac Terminal. \dt should list Miniflux's tables. We did not run this.
Performance and resources#
Compose has no RAM minimum of its own and we measured nothing. Run docker stats (Ctrl+C to leave) and read MEM USAGE for db and miniflux. Healthcheck intervals of 10 to 30 seconds keep the checks light. Docker's reference documents resource limits per service; add them only when docker stats shows a real problem.
FAQ#
Is "Compose v2" different from v5? The command is the same: docker compose. Docker named the new major release v5 to avoid confusion with the old file versions 2.x and 3.x (release notes of 5.0.0).
Named volume or bind mount? A bind mount (./db) is a plain folder you can see, and it matches our ~/docker_volumes/<app> rule. A named volume is managed by Docker and avoids owner problems on Windows. Neither is a backup.
What is Compose Watch? A developer feature that syncs source code into containers you build yourself. The docs say it does not track services from pre-built images, so it does not update home-lab apps.
Can I run several stacks? Yes: one folder and project name each, or the include file from Step 6. Keep service names unique on a shared network.
Can Compose update my containers by itself? No. docker compose pull and up -d update on your command. For notifications see Diun; for a graphical view of stacks see Dockge, Komodo or Arcane.
Sources#
- Docker Compose: repository (Apache-2.0), release v5.8.1 (27 November 2026), release v5.0.0 (2 December 2025, "Why v5"), README at v5.8.1 (legacy v1 branch) and CLI references config, up, down, pull
- Docker docs (read December 2026): install overview, Linux plugin, how Compose works, interpolation, variable precedence, startup order, profiles, include, project name, Compose Watch, version and name, workload specification, port publishing, packet filtering and ufw
- Miniflux 2.3.6 (29 November 2026, Apache-2.0): Docker page, Compose examples (basic, Traefik, Caddy), Dockerfile, settings source
- Postgres image: Docker official image notes (PGDATA change in 18); tag
18.7checked on Docker Hub - Traefik v3.8.0: Docker routing labels and the basic auth note on doubled dollar signs; Caddy: tls directive
- Issues read on 5 December 2026: compose 4485, 9367, 10293, 11158, 11582, 11935, 12068, 14429, 14585, 14587; postgres 435, 1370
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 files and the issues above.