Docker has become the standard for deploying applications — and for good reason. It packages everything your app needs into a single, portable container that runs consistently anywhere. If you're using Vultr as your cloud provider, spinning up a Docker environment is fast, affordable, and production-ready in minutes.
This guide walks you through setting up Docker on a Vultr instance from scratch — covering Ubuntu setup, your first container, Docker Compose for multi-service apps, and production hardening.
Why Run Docker on Vultr?
Vultr's block storage and high-performance SSDs make it ideal for container workloads. With plans starting at $5/month, you get more bang for your buck compared to AWS or GCP for self-hosted container infrastructure. You also get full root access, which means Docker runs without artificial restrictions.
Key advantages of Vultr Docker setup:
- Cost efficiency: Vultr's flat-rate pricing means no surprise egress fees — critical for container registries and image pulls.
- Performance: NVMe-backed storage and Intel/AMD CPUs deliver fast container boot times.
- Global reach: 25+ data center locations for low-latency container distribution.
- Flexibility: Spin up Docker on Ubuntu, Debian, Fedora, or CentOS in seconds.
Prerequisites
You'll need:
- A Vultr account (sign up at vultr.com)
- A Vultr cloud instance running Ubuntu 22.04 LTS (or 24.04 LTS)
- SSH access to your instance
- A basic understanding of the command line
Step 1: Deploy a Vultr Instance
If you haven't already, deploy a new Vultr instance:
- Log into your Vultr dashboard
- Click Deploy New Instance
- Choose Cloud Compute → Ubuntu 22.04 LTS
- Pick a location close to your users
- Select a plan — the $6/month 1 vCPU / 1GB RAM plan works for learning; go with $20/month 2 vCPU / 2GB for production-like workloads
- Enable IPv6 and add your SSH key
- Click Deploy Now
Your instance will be ready in under 60 seconds.
Step 2: Install Docker on Ubuntu
SSH into your instance and follow these steps:
# Update package index
sudo apt update && sudo apt upgrade -y
# Install Docker dependencies
sudo apt install -y ca-certificates curl gnupg lsb-release
# Add Docker's official GPG key
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
# Set up Docker repository
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
# Install Docker Engine
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Enable and start Docker
sudo systemctl enable --now docker
# Verify installation
sudo docker run --rm hello-world
If everything worked, you'll see Docker's hello-world message confirming your installation is functional.
Step 3: Run Your First Container
Let's verify your setup by running a lightweight web server:
# Run a minimal NGINX container
sudo docker run -d --name my-nginx -p 80:80 nginx:alpine
# Check it's running
sudo docker ps
# Test it
curl http://localhost
Open your browser and navigate to your server's IP address — you'll see the NGINX welcome page. You've just deployed a containerized web server in under 2 minutes.
Step 4: Use Docker Compose for Multi-Container Apps
Most real applications involve multiple containers — a web app, a database, a cache layer. Docker Compose manages this elegantly.
# Create a project directory
mkdir my-app && cd my-app
# Create docker-compose.yml
cat > docker-compose.yml << 'EOF'
version: "3.9"
services:
web:
image: nginx:alpine
ports:
- "80:80"
volumes:
- ./html:/usr/share/nginx/html:ro
restart: unless-stopped
redis:
image: redis:alpine
restart: unless-stopped
volumes:
html:
EOF
# Create a simple HTML page
mkdir html
echo "<h1>Hello from Docker on Vultr!</h1>" > html/index.html
# Start everything
docker compose up -d
# Check status
docker compose ps
Your two-service stack (NGINX + Redis) is now running. Docker Compose handles networking between containers automatically.
Step 5: Persist Data with Vultr Block Storage
Containers are ephemeral — data inside them disappears when the container is removed. For databases and persistent data, attach a Vultr Block Storage volume:
# In Vultr dashboard: Deploy Block Storage (starting at $0.50/GB/month)
# On your instance, find the block device name (usually /dev/vdb)
sudo fdisk -l | grep vdb
# Format and mount it
sudo mkfs.ext4 /dev/vdb
sudo mkdir /data
sudo mount /dev/vdb /data
# Add to /etc/fstab for auto-mount on reboot
echo '/dev/vdb /data ext4 defaults,nofail 0 2' | sudo tee -a /etc/fstab
# Update docker-compose.yml to use the volume:
# volumes:
# - /data/postgres:/var/lib/postgresql/data
Your container data now survives instance reboots and container reschedules.
Step 6: Harden Your Docker Setup
Before going to production, apply these security best practices:
- Don't run containers as root: Add a non-root user and manage Docker permissions properly.
- Use specific image tags: Avoid
:latest— pin tonginx:1.27-alpineor similar for reproducible builds. - Scan images for vulnerabilities: Use a tool like Trivy (
trivy image nginx:alpine). - Enable UFW firewall: Only expose the ports you need. Docker can conflict with UFW's iptables rules — configure it properly.
- Set resource limits: Prevent a runaway container from consuming all memory or CPU.
# Example: resource-limited container
docker run -d \
--name limited-app \
--memory="512m" \
--cpus="0.5" \
-p 3000:3000 \
my-app:latest
Docker on Vultr vs Alternatives
If you're weighing Vultr against other VPS providers for container workloads, here's the short version: Vultr's pricing transparency and flat-rate billing make it significantly cheaper for Docker-heavy workloads. With DigitalOcean and Linode, you're looking at similar performance, but Vultr's global data center spread and block storage integration give it an edge for distributed container architectures.
For a full pricing breakdown, see our comparison guide — though that focuses on cloud infrastructure costs, the pricing principles apply to container hosting as well.
Next Steps
You've got a working Docker environment on Vultr. From here, you can:
- Set up a private container registry using Harbor or AWS ECR
- Explore Vultr Kubernetes Engine (VKE) for orchestrated multi-container workloads
- Implement CI/CD with GitHub Actions + Docker + Vultr deployment
- Configure automated backups with Vultr's snapshot feature
Docker on Vultr gives you production-grade infrastructure at startup costs that cloud giants can't match. Get started with a $5 instance today.