Disclosure: this page contains affiliate links. If you buy through them we may earn a commission at no extra cost to you.
Docker lets you ship any app as a self-contained container, and a VPS is the natural home for it. This covers Ubuntu 24.04.
Step 1: Install Docker Engine
Use Docker’s official convenience script, then add your user to the docker group:
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER
Log out and back in for the group change to apply.
Step 2: Install Docker Compose
sudo apt install -y docker-compose-plugin
Step 3: Run a container
docker run -d --name hello -p 8080:80 nginx
Visit http://your-vps-ip:8080 — you should see the Nginx welcome page.
Step 4: Keep it tidy
- Set restart policies (
--restart unless-stopped) so containers survive reboots. - Use a
docker-compose.ymlto define multi-service stacks as code. - Keep images updated and avoid running containers as root where possible.
Docker itself is light, but running containers need RAM. RackNerd’s 2 GB plan at $35.99/yr comfortably runs several small containers with full root and a dedicated IPv4.
See RackNerd's current deals