DevOps12 min read•Updated November 2026

VPS Hosting for Docker Swarm

Quick answer

Docker Swarm is the orchestration mode built into Docker Engine. To run it on VPS servers, initialise a swarm on one node, join three (or five) managers for a fault-tolerant Raft quorum plus any workers, and open only the cluster ports (TCP 2377, TCP/UDP 7946 and UDP 4789) on a private network. Deploy applications as stacks from Compose files, use overlay networks, keep passwords in Swarm secrets, configure rolling updates with health checks, put a reverse proxy such as Traefik or Nginx in front for TLS, pin stateful services to labelled nodes, back up the manager state and volumes, and monitor nodes and services.

Many teams outgrow a single Docker host but do not want the complexity of Kubernetes. Swarm mode fills that gap: it uses the same Docker CLI and Compose file format teams already know, adds multi-node scheduling, service discovery, rolling updates and secrets, and runs comfortably on a few VPS servers. Swarm mode remains part of Docker Engine, though it receives fewer new features than Kubernetes, so check that it covers your needs before committing.

Key Concepts

  • Managers store cluster state with the Raft consensus algorithm and schedule tasks; they can also run services.
  • Workers run tasks assigned by managers.
  • Services describe the desired state: image, replicas, networks, update policy.
  • Stacks group services defined in a Compose file and deployed together.

Managers and Quorum

A swarm keeps working while a majority of managers is available. With three managers, it survives one failure; with five, it survives two. Two managers tolerate no failures, so they offer no advantage over one. Most small clusters use three managers. Spread them across different hosts, and keep regular backups of the manager state in case quorum is lost.

Setting Up

docker swarm init --advertise-addr <private-ip>
docker swarm join-token manager   # prints command to add managers
docker swarm join-token worker    # prints command to add workers
docker node ls

Advertise private IP addresses so cluster traffic stays off the public interface. The cluster uses TCP 2377 for management, TCP and UDP 7946 for node communication, and UDP 4789 for overlay network traffic. Allow these only between cluster nodes in the firewall. Keep join tokens secret and rotate them if they leak.

Deploying Stacks

Write services in a Compose file with a deploy section for replicas, placement, resources and update policy, then run docker stack deploy -c stack.yml app. Note that some Compose options used for single hosts (such as build) are ignored in stack deployments, so build images in CI and push them to a registry first (see our private registry guide). Use --with-registry-auth when images are private.

Overlay Networks and Ingress

Overlay networks connect containers across nodes, with service names resolving through built-in DNS. Create separate networks for frontends and backends so databases are not reachable from everything. Overlay traffic can be encrypted with the encrypted option at some performance cost. Published ports use the routing mesh by default, so a port published on the swarm is reachable on every node and forwarded to a healthy task.

Reverse Proxy and TLS

Run Traefik or Nginx as a service on manager or edge nodes, terminating HTTPS and routing by hostname to services on an overlay network. Traefik can discover Swarm services through labels and obtain Let's Encrypt certificates automatically; if you run more than one replica, store certificates in a way all replicas can use, or keep a single replica with fast restart. Point DNS at the edge nodes or a floating IP.

Secrets and Configs

Swarm secrets are stored encrypted in the Raft log and mounted into containers as files under /run/secrets, only for services that request them. Use them for database passwords and API keys instead of environment variables in Compose files. Configs work the same way for non-sensitive configuration files. Secrets are immutable, so rotate by creating a new secret and updating the service.

Rolling Updates and Rollbacks

  • Set update_config with parallelism, delay and order: start-first for zero-downtime updates where possible.
  • Define health checks so Swarm waits for new tasks to be healthy.
  • Set failure_action: rollback to revert automatically when updates fail.
  • Deploy immutable image tags so rollbacks are predictable.

Our zero-downtime deployment guide explains the underlying ideas.

Stateful Services

Swarm volumes are local to each node by default. Pin databases and other stateful services to a specific node with placement constraints on node labels, so they always restart where their data lives, or run databases on separate VPS servers outside the swarm. Shared storage drivers exist but add complexity and failure modes; test carefully before relying on them.

Backups

Back up the swarm state from /var/lib/docker/swarm on a manager (with Docker stopped on that manager, or following Docker's documented procedure) along with the unlock key if autolock is enabled. Keep stack files in Git so services can be recreated, and back up volume data and databases with application-aware tools.

Monitoring

Watch node availability, service replica counts against desired counts, task restarts, resource use per node and container, and certificate expiry. Prometheus with node exporter and cAdvisor, plus Grafana dashboards, is a common stack; see our monitoring guide.

Sizing

ClusterSuggested plans
Small HA cluster, managers run services3 × 2 vCores / 8 GB
Managers plus dedicated workers3 × 2 vCores / 8 GB managers, 4–8 vCore workers
Busy applications with many replicasSeveral 8 vCore / 32 GB workers

Keep enough spare capacity that the remaining nodes can run all replicas if one node fails.

Swarm or K3s?

Swarm is easier to learn and operate, and Compose files carry over directly. K3s offers the wider Kubernetes ecosystem: Helm charts, operators, GitOps tools and more advanced scheduling. Small teams with a few services often start with Swarm; teams expecting many services or needing Kubernetes tooling choose K3s (see our K3s production guide).

Common Mistakes

  • Two managers, which cannot tolerate any failure.
  • Exposing cluster ports to the internet.
  • Passwords in Compose environment variables instead of secrets.
  • Stateful services that move to a node without their data.
  • No health checks, so broken updates roll out fully.

In Short

Use three managers, keep cluster traffic private, deploy stacks from Compose files with images from a registry, use secrets, configure health-checked rolling updates, pin stateful services, back up state and volumes, and monitor replicas.

SkyRainCloud Plans for This Workload

Swarm adds almost no overhead. Three 2 vCore / 8 GB managers that also run light services make a resilient small cluster; add 4 or 8 vCore workers for heavier applications.

AMD EPYC 7C13 VPS

Dedicated KVM vCores on AMD EPYC 7C13 (up to 3.70 GHz) with DDR4 ECC memory, NVMe SSD and an unmetered 1 Gbps port.

PlanvCoresRAMStorageNetworkPriceGood forBuy
VPS 1 — AMD28 GB DDR4 ECC40 GB NVMe SSD1 Gbps, unmetered₹649/monthWebsites, small APIs, bots, staging and VPN serversOrder
VPS 2 — AMD416 GB DDR4 ECC80 GB NVMe SSD1 Gbps, unmetered₹1,299/monthWooCommerce, Node.js/Python backends, Docker Compose stacks, CI runnersOrder
VPS 3 — AMD832 GB DDR4 ECC150 GB NVMe SSD1 Gbps, unmetered₹2,499/monthProduction databases, high-traffic sites, multi-container appsOrder
VPS 4 — AMD1664 GB DDR4 ECC250 GB NVMe SSD1 Gbps, unmetered₹4,899/monthLarge production workloads, SaaS platforms, analytics, in-memory cachesOrder

Intel Xeon Platinum 8269CY VPS

KVM VPS on Intel Xeon Platinum 8269CY (up to 3.80 GHz Turbo) with DDR4 ECC memory, NVMe SSD, full root access and an unmetered 1 Gbps port.

PlanvCoresRAMStorageNetworkPriceGood forBuy
VPS 1 — Intel28 GB DDR4 ECC40 GB NVMe SSD1 Gbps, unmetered₹649/monthBusiness websites, small apps, scheduled jobs and botsOrder
VPS 2 — Intel416 GB DDR4 ECC80 GB NVMe SSD1 Gbps, unmetered₹1,169/monthBusiness software, mid-size databases, several sites on one serverCheck stock
VPS 3 — Intel832 GB DDR4 ECC150 GB NVMe SSD1 Gbps, unmetered₹2,249/monthERP/CRM stacks, heavier databases, multiple production appsCheck stock
VPS 4 — Intel1664 GB DDR4 ECC250 GB NVMe SSD1 Gbps, unmetered₹4,299/monthHigh-memory workloads and consolidated production serversCheck stock

Prices are monthly in INR as listed on the SkyRainCloud store (verified 2026-11-14). Stock and final pricing are shown on the product page at checkout.

Frequently Asked Questions

Is Docker Swarm still supported?
Swarm mode remains part of Docker Engine, though it gets fewer new features than Kubernetes.
How many managers should a swarm have?
Three for most clusters (tolerates one failure) or five (tolerates two); always an odd number.
Which ports does Docker Swarm use?
TCP 2377 for cluster management, TCP and UDP 7946 for node communication and UDP 4789 for overlay traffic.
Can I use Compose files with Swarm?
Yes. Deploy them as stacks with docker stack deploy; some single-host options such as build are ignored.
How do I store passwords in Swarm?
Use Swarm secrets, which are encrypted in the cluster state and mounted only into services that request them.
How do rolling updates work?
Configure update_config with parallelism, delay, start-first order and rollback on failure, plus health checks.
How should databases run in Swarm?
Pin them to labelled nodes where their volumes live, or run them on separate servers outside the swarm.
How do I get HTTPS for Swarm services?
Run Traefik or Nginx as an edge service that terminates TLS and routes to services on overlay networks.
Should I choose Swarm or K3s?
Swarm for simplicity with a few services; K3s for the Kubernetes ecosystem and larger platforms.
Which plans suit Docker Swarm?
Three 2 vCore / 8 GB managers for a small cluster, plus 4 to 8 vCore workers for heavier applications.
Instant UPI • ₹649/mo
Fast KVM Cloud Provisioning