Install Docker on an Ubuntu VPS: official commands and what the server costs
How to install Docker on an Ubuntu VPS with the official script, what Docker warns about that method, and the monthly cost of a server for containers.

| Provider | Plan | Resources | Price | Terms | Link |
|---|---|---|---|---|---|
| Hostinger | KVM 1 | 1 vCPU · 4 GB · 50 GB NVMe | $6.49/mo | 24-month term; renews at $11.99 | Hostinger |
| Hostinger | KVM 2 | 2 vCPU · 8 GB · 100 GB NVMe | $8.79/mo | 24-month term; renews at $14.99 | Hostinger |
| Hetzner | CX23 | 2 vCPU · 4 GB · 40 GB NVMe | from €5.99/mo | Excl. VAT, hourly; out of stock when checked | hetzner.com |
| DigitalOcean | Basic 2 GB | 1 vCPU · 2 GB · 50 GB SSD | $12/mo | Hourly, no contract | digitalocean.com |
| DigitalOcean | Basic 4 GB | 2 vCPU · 4 GB · 80 GB SSD | $24/mo | Hourly, no contract | digitalocean.com |
Short answer
The fastest way to get Docker on an Ubuntu VPS is the official get.docker.com script: two commands and it is installed. It suits tests and personal servers; for production, Docker recommends the repository method.
Quick install
Connect to the server over SSH and run:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo docker run hello-worldThe last command pulls a test image and confirms Docker works.
What Docker warns about the script
The official docs are clear about its limits:
- It needs
rootorsudoprivileges. - It detects your distribution and configures the package manager for you.
- It does not let you customize most parameters.
- It installs dependencies without asking for confirmation.
- It always installs the latest stable release.
That is why Docker says it is not recommended for production environments and suggests examining any downloaded script before running it. The same page explains the alternative: add Docker's repository and install with apt.
Which VPS to pick
Docker itself uses little: the containers are what need resources. For two or three light services a 4 GB plan is enough. If you will run a database next to an app, 8 GB gives more room, and there Hostinger KVM 2 is the cheapest per gigabyte if you accept paying 24 months.
After installing
Three things worth doing right after the install finishes:
- Check whether Docker Compose is there with
docker compose version. You will need it to bring up several containers from a single file. - By default every command needs
sudoin front. Docker's post-install guide explains how to add your user to thedockergroup, and warns that the group grants root-level privileges. - Containers do not come back on their own after a reboot unless you create them with a policy such as
--restart unless-stopped.
If you ever want to upgrade Docker, the docs note that re-running the script can cause issues: use the system package manager for that instead.
Sources
Prices read on the official pages on November 10, 2026. They change often: confirm the final price in each provider's checkout.
Sources & References (4)
- Docker↗
Docker Docs: Install Docker Engine on Ubuntu
Convenience script, its limits and the repository method.
- Hostinger↗
Hostinger: VPS hosting plans and prices
KVM 1 to KVM 8 specs, 24-month promo prices and renewal prices.
- Hetzner↗
Hetzner Cloud: Cost-Optimized plans
CX23 specs, price excluding VAT and availability.
- DigitalOcean↗
DigitalOcean: Droplet pricing
Basic Droplet sizes with hourly and monthly prices.
Share this guide with friends
Share directly via WhatsApp, Telegram, or X with verified technical preview.
Did you find this article interesting?
Your vote helps calibrate recommendations in the community.
Comments (0)
Recommended Reading

How to Fix Out of Video Memory and ERR_SYS_MALLOC in Unreal Engine 5: Pagefile Setup
Resolve Out of Video Memory errors and VRAM allocation crashes in Unreal Engine 5 PC games by optimizing Windows virtual memory pagefile.

How to Fix VCRUNTIME140.dll and MSVCP140.dll Missing Error in Windows 11 & 10
Official fix for 'The code execution cannot proceed because VCRUNTIME140.dll was not found': install Microsoft Visual C++ x86 and x64 redistributables.
