Docker on a VPS: installation and the first container
Updated 25-10-2026
Docker runs applications in containers: no manual installation of dependencies and easy updates. Here is the installation on Debian or Ubuntu and an example with Docker Compose.
Installation
Docker's official script installs Docker together with Docker Compose:
curl -fsSL https://get.docker.com | shCheck that it works:
docker run hello-worldYour first application with Docker Compose
An example: Uptime Kuma, a monitoring tool that tells you when your website or server stops working.
mkdir -p /opt/uptime-kuma && cd /opt/uptime-kuma
nano compose.yamlPaste into the file:
services:
uptime-kuma:
image: louislam/uptime-kuma:1
restart: unless-stopped
ports:
- "3001:3001"
volumes:
- ./data:/app/dataStart it:
docker compose up -dThe application is at http://IP_ADDRESS:3001. If you restrict traffic in the Firewall tab, open port 3001 there.
Useful commands
docker ps: running containers.docker compose logs -f: the application's logs live.docker compose pull && docker compose up -d: update to a new version.docker system dfanddocker system prune: how much space images take and cleaning up unused ones.
Docker and the system firewall
Docker opens published ports past the ufw rules in the system. The rules in the panel's Firewall tab work in front of the server, so they protect Docker's ports too.
Keep application data in volumes (like
./datain the example) and make backups before updates.