Where can you host Docker containers in India?
Host Docker containers in India on a Linux KVM VPS with full root; shared hosting and container-based VPS usually cannot run Docker. A RapidServer VPS starts at ₹581/mo plus 18% GST in Mumbai (BOM1) or Delhi NCR (DEL1), with a ready Docker image on Ubuntu LTS. Start apps (for example ERPNext) with docker compose up -d, keep data in volumes and serve them through Nginx with HTTPS.
VPS for Docker: why it has to be KVM
Installing Docker Engine needs root, and containers run on the server's own Linux kernel. Two common kinds of hosting don't give you that:
- Shared hosting: one account on a shared server, with no root, so Docker can't be installed. Our web hosting is cPanel on LiteSpeed for PHP sites.
- Container-based VPS (OpenVZ or LXC): these often block Docker and kernel modules.
A KVM VPS is a full virtual machine with its own kernel, memory and disk, so Docker works as on a physical server. Every RapidServer VPS runs on KVM with dedicated vCPU, NVMe and full root, as a VPS in Mumbai or a VPS in Delhi; Noida and Gurugram are served from DEL1 (data centers).
Docker on a VPS vs shared hosting vs managed container platforms
| Docker on a KVM VPS | Shared hosting | Managed container platform | |
|---|---|---|---|
| Runs your Docker images | Yes, any image | No | Yes, within the platform's limits |
| Docker Compose | Yes, one compose.yaml | No | Depends on the platform |
| Root access | Full root | No | No |
| Server updates and security | You, or managed support | The host | The platform |
| Persistent data | Named volumes on your NVMe disk | Files in your account | The platform's storage options |
| Pricing | Fixed monthly plan | Fixed plan | Varies by platform |
Step 1: Install Docker on the VPS
Order a VPS and pick the Docker image, built on Ubuntu LTS. It is usually ready a few minutes after payment. Log in over SSH (SSH kya hai) and check both tools:
docker --version docker compose version
On plain Ubuntu 24.04 or 22.04 LTS, install Docker Engine and the Compose plugin from Docker's official apt repository, as its Ubuntu install guide shows; remove old packages such as docker.io first, and copy the commands fresh, as they change:
sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo docker run hello-world
To run docker without sudo, add your user to the docker group (post-install steps); Docker warns that this grants root-level privileges.
Step 2: Docker Compose hosting: run your app
Docker Compose describes your app in one compose.yaml. Make a folder such as ~/my-app, keep secrets in a .env file there with chmod 600 .env, and create:
services:
app:
image: ghcr.io/you/my-app:1.4.2
restart: unless-stopped
env_file: .env
ports:
- "127.0.0.1:8080:3000"
volumes:
- app_data:/app/data
volumes:
app_data:
- Restart policy:
unless-stoppedrestarts the container whenever it stops, unless you stopped it yourself (restart policies). On Ubuntu the Docker service starts on boot by default, so the app returns after a reboot. - Volumes: files written inside a container go when it is removed; a named volume keeps them (volumes), so point uploads and database files at one.
Start it in the background (docker compose up) and check it:
cd ~/my-app docker compose up -d docker compose ps docker compose logs -f app
Add a database as another service with its own named volume and no ports line; the app reaches it by its service name.
Docker, ufw and HTTPS: keep ports on 127.0.0.1
Docker publishes ports on every host address (0.0.0.0 and [::]) by default, which Docker's port publishing guide calls insecure. With ufw, published container ports skip your firewall rules: Docker routes their traffic before ufw sees it (packet filtering and firewalls).
So publish app ports as 127.0.0.1:8080:3000, which only the server itself can reach, don't publish database ports, and let Nginx take ports 80 and 443. Run sudo apt install nginx and create /etc/nginx/sites-available/example.com:
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Enable the site and open only SSH, 80 and 443 in ufw (sudo ufw allow OpenSSH, sudo ufw allow 80,443/tcp, sudo ufw enable; see our firewall guide), then add free HTTPS with Certbot as in our Node.js hosting guide.
Updating containers and cleaning up
Pin image versions, as in my-app:1.4.2, so you know what runs. To update, change the tag, take a snapshot before a big upgrade, then pull and recreate. docker compose up -d recreates only containers whose image or settings changed, and keeps mounted volumes:
cd ~/my-app docker compose pull docker compose up -d docker image prune
docker image prune removes dangling images; -a removes every image no container uses (image prune). If you build from a Dockerfile on the server, run docker compose build app, then docker compose up --no-deps -d app (Compose in production). Container logs grow too, so turn on log rotation, as the post-install guide suggests.
Backing up Docker volumes
Images can be pulled again; your data can't. Back up the volumes. docker compose down keeps named volumes, but docker compose down -v deletes them. Following Docker's volume backup example, stop the app and archive its data with a throwaway container (the name comes from docker compose ps):
cd ~/my-app docker compose stop app docker run --rm --volumes-from my-app-app-1 -v $(pwd):/backup ubuntu tar cvf /backup/app-data.tar /app/data docker compose start app
For a database container, take dumps with pg_dump or mysqldump instead. Every RapidServer VPS also gets daily backups kept for 7 days and snapshots on demand; copy your archives off the server as well (VPS backup guide).
Which VPS plan to pick for Docker
- Stardust (2 vCPU, 4 GB RAM, 20 GB NVMe, ₹581/mo): one small app, a bot or a staging copy.
- New Moon (2 vCPU, 4 GB RAM, 40 GB NVMe, ₹674/mo): a few small apps in Compose; the extra NVMe leaves room for images and volumes.
- Full Moon (4 vCPU, 8 GB RAM, 160 GB NVMe, ₹1,723/mo): a production app with PostgreSQL and Redis.
Watch docker stats and the client area graphs, and move up when they say so; upgrades are prorated, and billing is monthly plus 18% GST. Support works 24/7 in English and Hindi; managed support adds ₹1,499/mo (managed vs unmanaged).
Dedicated vCPU, NVMe, full root and a ready Docker image on Ubuntu LTS in Mumbai or Delhi NCR, ready a few minutes after payment, from ₹581/mo.
See VPS plansQuestions
Can shared hosting run Docker?+
What kind of VPS do I need for Docker?+
How much does Docker hosting cost in India?+
Why can people reach my container when ufw is on?+
127.0.0.1:8080:3000, don't publish database ports, and put Nginx in front on 80 and 443.Will my containers start again after a reboot?+
restart: unless-stopped. On Ubuntu the Docker service starts on boot by default and brings those containers back.Does docker compose down delete my data?+
docker compose down -v deletes them, so back up first.Docker ko VPS par kaise chalayein?+
compose.yaml mein likhiye, named volume aur restart: unless-stopped rakhiye, port 127.0.0.1 par bind kijiye aur docker compose up -d chalaiye. Phir Nginx aur Certbot se HTTPS lagaiye. VPS ₹581/mo plus 18% GST se shuru hota hai.