Menu

Docker Compose on a 1 GiB VPS: memory limits, swap and log rotation that keep it up
📰

Docker Compose on a 1 GiB VPS: memory limits, swap and log rotation that keep it up

DEV Community: docker·Overnight.Host·about 21 hours ago
#TXJuyQ0K
#devtodocker#devto#dev#docker#compose
Long article (1076 words) — no AI summary yet.
Reading 0:00
15s threshold

Docker is not the problem on a 1 GiB server. The daemon idles under 50 MB. The real problem is that Compose will happily start five containers with no memory limits at all, and when memory runs out the kernel's OOM killer does not ask which one you meant to keep. Sometimes it picks sshd.

Here are six things to set up on a small box before you add a single container.

1. Install Docker Engine from Docker's repo, not docker.io

Ubuntu's own repository ships an old, renamed build called docker.io . Add Docker's official apt repository instead (the steps are in Docker's Ubuntu install guide), then:

sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin sudo usermod -aG docker "$USER" newgrp docker

Enter fullscreen mode

Exit fullscreen mode

From here on it is docker compose , a subcommand of the docker CLI with no hyphen, not the old standalone docker-compose binary. The compose file syntax is the same either way.

2.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.