Skip to content
Free website migration on every plan, done by our team.Learn more ›
Servers

How to run Docker on a VPS

Install Docker and Docker Compose on an Ubuntu VPS, run your first containers behind a reverse proxy with HTTPS, and keep data safe with volumes.

Short answer: On a KVM VPS running Ubuntu, install Docker from the official repository, use Docker Compose to define your services, store data in volumes, put a reverse proxy in front for HTTPS, and back up the volumes, not just the containers.

1. Prepare the server

Secure the VPS first. See first 10 things to do on a VPS.

2. Install Docker

Follow Docker's official instructions for Ubuntu to add their repository, then install Docker Engine and the Compose plugin. Check it works:

docker --version
docker compose version

3. Define services with Compose

A docker-compose.yml file lists your containers, ports, volumes and environment variables, so the whole stack starts with one command:

docker compose up -d

4. Add HTTPS with a reverse proxy

Run Nginx or another reverse proxy in front of your apps to handle domains and free SSL certificates. See Nginx as a reverse proxy.

5. Keep data safe

  • Store databases and uploads in named volumes.
  • Back up volumes off the server. See the 3-2-1 rule.

Frequently asked questions

Does Docker work on any VPS?

It works best on KVM-based servers. See KVM vs container VPS.

How much RAM do I need?

Depends on the containers. Start with at least 2 to 4 GB. See choosing a VPS plan.

Ready when you are

Host it where it performs

NVMe speed, offshore privacy and a written SLA — live in minutes on AuroxHost.