How much server a container host needs
Docker itself is light. The containers decide the size, and building images needs far more than running them. These are starting points, not guarantees:
| What you run | RAM | Disk | Plan |
|---|---|---|---|
| 2–4 small services, images built elsewhere | 2 GB | 40 GB | Basic |
| App, database, cache and proxy | 4 GB | 60 GB | Standard |
| Several projects, or builds on the server | 8 GB | 100 GB | Professional |
- Basic₼27.90/mo
2 vCPU · 2 GB RAM · 40 GB NVMe
Public IP +₼10/mo, With public IP: ₼37.90/mo
- Standard₼39.90/mo
2 vCPU · 4 GB RAM · 60 GB NVMe
Public IP +₼10/mo, With public IP: ₼49.90/mo
- Professional₼73.90/mo
4 vCPU · 8 GB RAM · 100 GB NVMe
Public IP +₼10/mo, With public IP: ₼83.90/mo
| Plan | vCPU | RAM | NVMe | Server, monthly | With public IP |
|---|---|---|---|---|---|
| Basic | 2 | 2 GB | 40 GB | ₼27.90/mo | ₼37.90/mo |
| Standard | 2 | 4 GB | 60 GB | ₼39.90/mo | ₼49.90/mo |
| Professional | 4 | 8 GB | 100 GB | ₼73.90/mo | ₼83.90/mo |
Prices in manat (AZN), billed monthly. The public IP is +₼10 a month and is assigned automatically.
The smallest plan (1 vCPU, 1 GB RAM, 30 GB NVMe) runs one container well, but image layers fill 30 GB quickly. Standard is ₼49.90 a month. If 4 GB of RAM is enough but 60 GB of disk is not, Plus (4 vCPU, 4 GB RAM, 80 GB NVMe) is ₼65.90; for 100 GB of disk the smallest plan is Professional at ₼83.90. These prices are with public IP (₼10 a month of each), so the server can pull images and answer on 80 and 443 from the start.
Install Docker from the official repository
Use Docker's repository rather than the docker.io or snap package, so that Engine, Buildx and Compose come from one source and update with apt. The commands work on Ubuntu 24.04, Ubuntu 22.04 and Debian 12:
# Remove older packages, if any
sudo apt remove -y docker.io docker-compose podman-docker containerd runc 2>/dev/null
sudo apt update && sudo apt install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
. /etc/os-release
sudo curl -fsSL "https://download.docker.com/linux/$ID/gpg" -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
sudo tee /etc/apt/sources.list.d/docker.sources <<END
Types: deb
URIs: https://download.docker.com/linux/$ID
Suites: $VERSION_CODENAME
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
END
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo docker run --rm hello-worldAdding a user to the docker group removes the need for sudo, but membership is equal to root access. Give it only to people you would give root to.
A Compose file worth copying
This example runs Uptime Kuma, a monitoring page. The habits matter more than the app: a fixed major version, a named volume, a memory limit, a restart policy and a port bound to localhost.
# /opt/kuma/compose.yaml
services:
kuma:
image: louislam/uptime-kuma:2
restart: unless-stopped
mem_limit: 512m
ports:
- "127.0.0.1:3001:3001"
volumes:
- kuma-data:/app/data
volumes:
kuma-data:cd /opt/kuma
sudo docker compose up -d
sudo docker compose logs -f --tail=50
# later: update
sudo docker compose pull && sudo docker compose up -dPut nginx on the host in front of it and give it a certificate; the nginx and SSL guide has the server block. Keep passwords in a .env file with mode 600 next to the Compose file, and out of Git.
Why ufw does not protect published ports
Docker writes its own packet-filter rules, and traffic to a published port is forwarded to the container before ufw's input rules see it. ufw deny 5432 therefore does nothing for a database started with -p 5432:5432: it is open to the internet.
| Written in Compose | Reachable from |
|---|---|
"5432:5432" | Anywhere, whatever ufw says |
"127.0.0.1:5432:5432" | Only the server itself |
no ports at all | Only containers on the same Docker network |
The rule is short: databases and caches get no ports, web apps get 127.0.0.1, and only the reverse proxy listens on 80 and 443. If a port must be public for one address, filter it in the DOCKER-USER chain, which Docker leaves to you:
# Replace eth0 with your interface (ip route show default)
sudo iptables -I DOCKER-USER -i eth0 -p tcp -m conntrack \
--ctorigdstport 8080 --ctdir ORIGINAL ! -s 203.0.113.10 -j DROPThat rule disappears at reboot unless you save it, so binding to localhost is the better default. Check from another computer with nc -zv SERVER_IP 5432; testing on the server proves nothing. The rest of the hardening list is in securing a VPS.
Stop logs and old images from filling the disk
By default the json-file log driver has no size limit, so one noisy container can fill the disk and stop everything else. Set a limit in /etc/docker/daemon.json:
{
"log-driver": "local",
"log-opts": { "max-size": "10m", "max-file": "3" }
}Run sudo systemctl restart docker, then recreate containers with docker compose up -d --force-recreate; existing ones keep their old settings. For images:
sudo docker system df # what uses space
sudo docker system prune -af --filter "until=168h" # unused, older than 7 daysThat prune removes stopped containers and unused images but not volumes. Never add --volumes to a scheduled job: a stopped database can lose its data that way.
VPS with Docker or managed containers?
| Question | Docker on your VPS | Managed containers |
|---|---|---|
| Who patches the operating system? | You | The provider |
| Root access and host settings | Yes | No |
| Several Compose projects on one price | Yes | Usually sized per container |
| Person on your side who knows Linux | Required | Not required |
Choose a VPS when you want cron jobs, a VPN and databases beside the containers. Choose managed containers when you have an image to run and nobody to maintain a server. Unmanaged plans and sizes are listed on the pricing page.
Docker VPS questions
Can I run Docker on a 1 GB VPS?
Yes, for one or two light containers. Build images on your own computer or in CI, set memory limits, and do not expect a database and a web app to share 1 GB comfortably.
Does Docker Compose need a separate install?
No. The docker-compose-plugin package gives you the "docker compose" command. The old "docker-compose" program with a hyphen is no longer needed.
Why is my container open although ufw is enabled?
Because published ports are forwarded by Docker's own rules, not by the input chain ufw controls. Bind the port to 127.0.0.1 or remove the ports section.
Can I use Docker on a Windows VPS?
Use a Linux server for Linux containers. Docker Desktop depends on nested virtualisation, which you should not assume is available on a Windows VPS.
Is Docker preinstalled at Cloudraft?
No. You receive a clean Ubuntu, Debian or Windows Server system with full access and install Docker yourself with the commands above.