You install Docker on a VPS with one official script, after which you run applications as separate containers: isolated, easy to update and identical everywhere. A VPS is ideal for this, because you have full root access and your containers stay online 24/7. In this guide you install Docker on a Linux VPS, start your first container and learn how to use Docker securely.
What is Docker?
Docker is a platform for running applications in containers. A container holds an application with everything it needs, such as libraries and settings, but shares the kernel of the operating system. That makes containers lighter than virtual machines, lets you start them in seconds and makes an application on your VPS work exactly the same as on your own computer.
Why Docker on a VPS?
- Quick to install: you run databases, web servers and tools such as n8n with a single command.
- Isolated: every application runs in its own container, without conflicts between versions.
- Easy to update: pull a new version of the image and restart the container.
- Reproducible: with Docker Compose you capture your entire environment in a single file.
Which VPS do you need for Docker?
For a few light containers, a VPS with 1 to 2 cores and 2 GB of memory is enough. If you run databases or several applications at the same time, choose 4 GB or more. An NVMe VPS is ideal for Docker: images, volumes and databases benefit directly from the fast NVMe storage. If you run production applications that must always be online, choose a Linux VPS with high availability.
Step by step: installing Docker on a VPS
Step 1: update your server
Log in via SSH to your VPS with Ubuntu or Debian and install the latest updates:
apt update && apt upgrade -y Step 2: install Docker
Install Docker with the official installation script. It also installs Docker Compose:
curl -fsSL https://get.docker.com | sh Step 3: check the installation
Start a test container. If you see a welcome message, Docker is working:
docker run hello-world Step 4: start your first web server
Start an Nginx web server that is reachable on port 80 of your VPS:
docker run -d --name web -p 80:80 --restart unless-stopped nginx Open the IP address of your VPS in your browser and you will see the Nginx welcome page.
Docker Compose: multiple containers in one file
With Docker Compose you describe your entire environment in a single file. This example starts a web server and a database:
services:
web:
image: nginx
restart: unless-stopped
ports:
- "80:80"
db:
image: postgres:16
restart: unless-stopped
environment:
- POSTGRES_PASSWORD=wijzig-dit-wachtwoord
volumes:
- db_data:/var/lib/postgresql/data
volumes:
db_data: Start everything with a single command:
docker compose up -d You can find a practical example in our guide How to Self-Host n8n on a VPS.
Common Docker commands
docker ps
docker logs web
docker compose pull
docker compose up -d
docker system prune With these you view the running containers, read the logs, update images and clean up unused data.
Using Docker securely
- Watch out with the firewall: Docker opens published ports outside UFW. That is why you only publish ports that really need to be public, and bind internal services such as databases to 127.0.0.1 or do not publish a port for them at all.
- Use official images: choose images from the official maintainers and keep them up to date.
- Store data in volumes: that way your data is kept when you replace a container, and backups are easy.
- Secure the server itself: read our article How to secure a Linux VPS for the basic steps.
Hosting Docker at Xitens
Xitens has been a hosting provider in Amsterdam since 2014. Our VPS servers run in our own racks with our own network in a TIER III data centre in Amsterdam. You get full root access, choose your own operating system and can always reach your server via the noVNC console in the client area. All VPS plans offer 99.9% uptime, and our support engineers are available 24/7 by ticket and email.
Voor een paar lichte containers volstaat vaak al een affordable VPS met 2 GB werkgeheugen.
Frequently asked questions about Docker on a VPS
What is the difference between Docker and a VPS?
A VPS is a virtual server with its own operating system. Docker runs inside it and divides your applications into lightweight containers. They complement each other: the VPS provides the computing power, Docker organises your applications.
How many containers can I run on a VPS?
That depends on the memory and processor of your VPS and on what the containers do. Lightweight containers often use only tens of megabytes, databases more.
Does Docker also work on a Windows VPS?
Docker draait ook op Windows, maar vrijwel alle images zijn gemaakt voor Linux. Een Linux VPS is daarom de standaard en meest stabiele keuze voor Docker-containers.
Can I also run Kubernetes on a VPS?
Yes. With lightweight distributions such as k3s you run Kubernetes on one or more VPS servers. For most projects, however, Docker Compose is simpler and more than sufficient.

