Managed infrastructure for SMBs
Docker on a Linux VPS for Small Businesses: A Practical Setup Guide
The short answer
Docker lets a small business run its apps in containers: packaged units that hold an app and everything it needs, isolated from the rest of the server. On a Linux VPS, Docker makes deployments repeatable, keeps apps from stepping on each other, and makes moving to a bigger server much simpler. It also adds a few things to manage: images to update, data volumes to back up, and published ports to secure.
This guide shows small-business owners and IT leads when Docker is worth it, how to install it cleanly on a Linux VPS, how to run apps with Docker Compose, and the security, backup and monitoring habits that keep a container host healthy.
When Docker makes sense for a small business
| Situation | Docker a good fit? | Why |
|---|---|---|
| You run several small apps on one server | Yes | Each app gets its own container, dependencies and restart policy |
| Your developer or vendor ships a Compose file | Yes | You can run the app the same way they tested it |
| You want staging and production to match | Yes | The same image runs in both places |
| You run self-hosted tools (wiki, password manager, analytics, ticketing) | Yes | Most popular self-hosted tools publish official images |
| You run one WordPress or WooCommerce site | Maybe | A standard web stack is often simpler to manage without containers |
| Nobody on the team wants to learn containers | Maybe not | Unmaintained containers age just like unmaintained servers |
If Docker would be the only unfamiliar part of your setup, start with one non-critical app, learn the routine, then move more over.
Step 1: Pick the right kind of VPS
Docker runs best on a KVM VPS, where your server has its own kernel. Some container-based (LXC) VPS plans can run Docker with extra settings, but support varies and some features may not work. If Docker is central to your plans, choose KVM or ask your provider first. Our KVM vs LXC guide explains the difference.
Size the server for the apps inside the containers, plus a little headroom for Docker itself and for image downloads during updates. Our VPS sizing guide shows how to estimate CPU, memory and storage for each workload.
Step 2: Prepare and secure the server first
Containers do not replace basic server security. Before installing Docker:
- Update the system and turn on automatic security updates.
- Lock down SSH with keys, no password logins and no direct root login. Our SSH security guide walks through it.
- Create a named admin user for each person who manages the server.
- Set up a firewall that allows only SSH, HTTP and HTTPS by default.
Step 3: Install Docker from the official repository
Install Docker Engine and the Compose plugin from Docker's own package repository rather than an old distribution package. On Debian or Ubuntu, the flow looks like this (check Docker's documentation for the current commands for your release):
sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
# Add Docker's signing key and repository as shown in Docker's install docs, then:
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl enable --now docker
docker compose version
A note on the docker group: adding a user to it lets them run containers without sudo, but it is effectively root access to the server. Only add people who would already have full admin rights.
Step 4: Run apps with Docker Compose
Docker Compose describes an app in one file: which image to run, which ports to publish, where data lives and how to restart. Keep one folder per app, for example /srv/apps/wiki/, with its compose.yaml and an .env file for settings.
services:
app:
image: example/app:1.4
restart: unless-stopped
env_file: .env
ports:
- "127.0.0.1:8080:8080"
volumes:
- app-data:/var/lib/app
volumes:
app-data:
Three habits make Compose files easy to live with:
- Pin image versions (such as
1.4) instead oflatest, so updates happen when you choose. - Keep secrets out of the Compose file. Put them in the
.envfile, set its permissions so only admins can read it, and never commit it to a shared repository. - Use named volumes or bind mounts for all data. Anything written inside a container without a volume is lost when the container is replaced.
Step 5: Put a reverse proxy in front
Instead of publishing every app on its own public port, run a reverse proxy such as nginx, Caddy or Traefik on ports 80 and 443. It handles HTTPS certificates and sends each domain or path to the right container.
In the example above, the app only listens on the server's loopback address, so the proxy can reach it but the internet cannot. This also avoids a common surprise: Docker manages its own firewall rules, and a port published on all addresses can be reachable even when your host firewall appears to block it. Publish only what must be public, bind everything else to loopback, and test from outside the server to confirm.
Step 6: Back up volumes, not just the server
Container images can be downloaded again. Your data cannot. A good Docker backup covers:
- Volumes and bind mounts that hold app data and uploads.
- Databases, using each database's own dump tool so the backup is consistent.
- Compose files and
.envfiles, stored securely, so you can rebuild the stack anywhere.
Server snapshots are useful before big changes, but keep separate file and database backups off the server as well. Our Linux VPS backups and snapshots guide covers schedules, retention and restore tests.
Step 7: Update containers safely
Updating a containerized app is usually quick, but it still deserves a routine:
- Read the app's release notes for breaking changes.
- Back up its data and database.
- Change the pinned image version in
compose.yaml. - Run
docker compose pulland thendocker compose up -d. - Check the app and its logs with
docker compose logs. - If something breaks, set the old version back and run
docker compose up -dagain.
Update the host operating system and Docker Engine on a regular schedule too, and clear out unused images now and then with docker image prune so old layers do not fill the disk.
Step 8: Monitor the host and the containers
Watch the VPS the same way you would any server: external uptime checks, disk space, memory and backups. Then add container-level checks:
- Container status and restarts. A container that keeps restarting is failing quietly.
- Health checks. Add a
healthcheckto each service so Docker knows when an app is up but not working. - Log size. Set log rotation limits for the Docker logging driver so container logs cannot fill the disk.
- Disk used by images and volumes. Check it with
docker system df.
Our VPS monitoring and alerts guide explains thresholds, alert routing and runbooks.
A small-business Docker checklist
- KVM VPS sized for your apps, with headroom for updates.
- SSH hardened, firewall on, automatic security updates enabled.
- Docker Engine and Compose installed from the official repository.
- One folder and one Compose file per app, with pinned image versions.
- Secrets in protected
.envfiles, never in shared repositories. - A reverse proxy handling HTTPS, with app ports bound to loopback.
- Volume, database and config backups stored off the server, with a tested restore.
- Health checks, log rotation and disk alerts in place.
- A written update routine and a named owner for each app.
Docker, backups and monitoring work together
Docker makes apps easy to deploy and move. Backups make sure you can recover them, and monitoring tells you when something needs attention. This guide is part of our Linux VPS series: start with how to secure SSH on a Linux VPS, add Linux VPS backups and snapshots, choose the right VPS size, and set up VPS monitoring and alerts.
Next steps
A VPS gives you full control to run Docker your way. If you would rather have a team set up the container host, handle updates and backups, and respond when something breaks, our managed services can take that on for you. Read managed vs unmanaged VPS to compare, browse the plans, then tell us what you run or email sales@glasshosting.com. We will help you build a container setup that fits your business today and grows with it.
Host with GlassHosting
Order a plan or browse the knowledgebase for deeper how-tos.