October 04, 2026 · by Alex M.
Docker has become one of the most widely used tools in the DevOps and web development world. If you have a SSD VPS and want to run isolated, scalable, and easily manageable applications, Docker is the ideal solution. In this guide, you'll learn step by step how to install, configure, and use Docker on a Linux VPS running Ubuntu 22.04.
Docker is an open-source platform that allows you to package applications together with all their dependencies into a container. Containers are isolated from each other and from the host system, but share the same Linux kernel.
Key advantages:
To get the most out of Docker, you need a server with fast storage. An NVMe VPS delivers excellent read/write speeds for Docker images and volumes, significantly reducing build and deployment times.
Before you begin, make sure you have:
sudo privilegesIf you don't have a server yet, you can order a high-performance SSD VPS directly from CLIQHOST — with fast provisioning and an intuitive control panel.
Before any installation, update your package list and existing packages:
sudo apt update && sudo apt upgrade -y
Reboot the server if there are kernel updates:
sudo reboot
The recommended method is to use the official Docker repository rather than the package from Ubuntu's default repositories (which may be outdated).
sudo apt install -y ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) \
signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
docker --version
# Docker version 26.x.x, build ...
sudo docker run hello-world
If you see the Hello from Docker! message, the installation was successful.
By default, Docker requires sudo for every command. To remove this restriction, add your user to the docker group:
sudo usermod -aG docker $USER
Log out and back into your SSH session, then verify:
docker ps
# CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Warning: Users in the
dockergroup effectively have root access to the system through containers. Only add trusted users.
Make sure the Docker service starts automatically when the VPS reboots:
sudo systemctl enable docker
sudo systemctl enable containerd
Check the status:
sudo systemctl status docker
The main Docker configuration file is /etc/docker/daemon.json. Here is a recommended configuration for a production VPS:
sudo nano /etc/docker/daemon.json
{
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3"
},
"storage-driver": "overlay2",
"live-restore": true
}
Explanations:
log-driver + log-opts – limits container log sizes (essential on VPS with limited space)storage-driver: overlay2 – the most performant storage driver for Linuxlive-restore: true – containers remain running during a Docker daemon restartApply the changes:
sudo systemctl restart docker
Docker Compose lets you define and run multi-container applications using a simple YAML file. If you installed docker-compose-plugin in step 2, it's already available:
docker compose version
# Docker Compose version v2.x.x
Alternatively, install the standalone version:
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" \
-o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Let's build a practical example: an Nginx container serving a static HTML page.
mkdir ~/myapp && cd ~/myapp
mkdir html
echo "<h1>Hello from Docker on CLIQHOST VPS!</h1>" > html/index.html
nano docker-compose.yml
version: '3.9'
services:
web:
image: nginx:alpine
container_name: my_nginx
ports:
- "80:80"
volumes:
- ./html:/usr/share/nginx/html:ro
restart: unless-stopped
docker compose up -d
Open your VPS IP address in a browser — you'll see the HTML page.
docker compose ps # container status
docker compose logs -f # real-time logs
docker compose down # stop and remove containers
docker compose restart # restart containers
On a entry-level VPS, it's important to limit resources per container to prevent one service from consuming the entire server:
services:
app:
image: myapp:latest
deploy:
resources:
limits:
cpus: '0.50'
memory: 256M
reservations:
memory: 128M
Or via direct command:
docker run -d --name myapp \
--cpus="0.5" \
--memory="256m" \
myapp:latest
Container security is a critical topic, especially on servers exposed to the internet.
In your Dockerfile, specify a non-root user:
FROM node:18-alpine
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
USER appuser
Don't leave all containers on the default bridge network:
docker network create --driver bridge myapp_network
In docker-compose.yml:
networks:
myapp_network:
driver: bridge
Bind ports only to the local interface if external access isn't needed:
ports:
- "127.0.0.1:8080:80"
docker compose pull # download new images
docker compose up -d # restart with new images
docker image prune -f # clean up old images
For advanced server-level security, our server management service includes security audits and regular updates.
docker stats
This command displays CPU, memory, network and disk I/O for all active containers.
docker logs my_nginx --tail 100 -f
docker exec -it my_nginx sh
Regularly clean up unused resources to free up disk space:
# Remove everything unused (containers, networks, images, volumes)
docker system prune -a --volumes
# List existing volumes
docker volume ls
# Remove a specific volume
docker volume rm volume_name
On a CLIQHOST NVMe VPS, I/O operations with Docker images are significantly faster than on standard SSDs — this makes a real difference in intensive CI/CD pipelines.
A simple Dockerfile example for a Node.js application:
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3000
CMD ["node", "server.js"]
Build and run:
docker build -t mynodeapp:1.0 .
docker run -d -p 3000:3000 --name mynodeapp mynodeapp:1.0
nginx:1.25, not nginx:latest) — ensures reproducibilitydocker-compose.yml with clear commentsDocker transforms the way you deploy and manage applications on a Linux VPS. With the right configuration, you get an isolated, portable, and easily scalable environment — perfect for personal projects, staging, or production workloads.
If you're just getting started and looking for a VPS suited for Docker, the CLIQHOST team is here to help. Check out our SSD VPS and NVMe VPS offerings — servers optimised for container workloads, with technical support included. Have questions? Contact us and we'll find the right solution together.
Real reviews from customers who trust CLIQHOST for performance, reliability and expert technical support.
"We moved our online shop from a foreign host and the difference is night and day — pages load instantly and support replies in minutes, in Romanian."
"Migrated 12 client sites to CLIQHOST. Free migration, zero downtime, and the cPanel setup is exactly what my team needed. Highly recommend."
"Our NVMe VPS handles traffic spikes without a sweat. Full root, local datacenter, and billing in MDL — everything we wanted from a provider."