Skip to content
Mikhail Konin edited this page Feb 28, 2026 · 3 revisions

SwarmCLI

Deploy to multiple Docker Swarm servers from one repo β€” no config drift, no rollback scripts, no CI boilerplate.

  Your Repo ──→ SwarmCLI ──→ β”Œβ”€ dev-server   (17 stacks)
                              β”œβ”€ prod-server  (18 stacks)
                              └─ db-server    (1 stack)

The Problem

You manage several Docker Swarm servers β€” dev, staging, prod, maybe a dedicated database host. Each one has its own configs, scattered across repos or maintained by hand. Deploying means writing 50+ lines of CI pipeline per stack, copy-pasting docker stack deploy with slight variations. Rollback? A hand-written script you hope still works. Secrets live in .env files shared over Slack.

SwarmCLI exists to make all of this a single command.

What You Get

  • One-command deploy β€” swarmcli deploy my-stack sends the right config to the right server
  • Instant rollback β€” swarmcli rollback my-stack restores the previous version
  • Profile-based isolation β€” one repo, different settings per server
  • Minimal CI config β€” one CLI call instead of 50 lines of pipeline YAML
  • Docker-familiar commands β€” ls, ps, logs, deploy
  • Secure secrets β€” Docker Secrets & Configs, synced automatically before deploy
  • Per-stack isolation β€” each stack owns its repos and data
  • JSON output β€” --json for automation, webhooks, monitoring

Before vs After

Without SwarmCLI With SwarmCLI
Separate configs per server Single repo, profile-based isolation
docker stack deploy + manual steps swarmcli deploy my-stack
Custom rollback scripts swarmcli rollback my-stack
SSH + docker service logs swarmcli logs my-stack --service api
50+ lines of CI config per stack One CLI call, minimal pipeline config
Secrets in env files or manual sync swarmcli secret sync + Docker Secrets

How It Works

1. Create a profile        β†’  One per server (dev, prod, db)
2. Define stacks           β†’  Apps with services, variables, secrets
3. swarmcli deploy <stack> β†’  Syncs repos β†’ builds images β†’ deploys
4. swarmcli ps <stack>     β†’  Verify everything is running
5. swarmcli rollback       β†’  Something wrong? One command to undo

Who Is It For

Role How you use it
DevOps Set up profiles, CI/CD pipelines, manage secrets
Backend dev Deploy your services, check logs, rollback
Frontend dev Deploy, check service status
QA Deploy feature branches for testing

Quick Start

# Install
git clone https://github.com/KoninMikhail/swarmcli.git /opt/swarmcli && cd /opt/swarmcli
./install.sh

# Create your first profile from the example
cp -r examples/profiles/example-server profiles/my-server

# Select the profile
swarmcli use my-server

# Deploy a stack
swarmcli deploy core-backend

# Check status
swarmcli ps core-backend

# Something wrong? Rollback instantly
swarmcli rollback core-backend

β†’ See Quick-Start for the full walkthrough.

Documentation

Getting Started

Concepts

  • Glossary β€” terms and definitions
  • Profiles β€” server profiles and isolation
  • Stacks β€” application stacks
  • Services β€” service types (git, registry, none)
  • Deploy-Flow β€” what happens on deploy

Guides

Reference

Operations

Developer Documentation

For architecture details, ADRs, and internals β€” see docs/ in the main repository.

SwarmCLI vs Alternatives

SwarmCLI Raw Docker CLI Portainer Kubernetes
Profile isolation Built-in Manual No Namespaces
One-command deploy Yes Multiple steps GUI-based Helm
Built-in rollback Yes Manual Limited Yes
CI/CD integration Native DIY Webhooks DIY
Secrets management Built-in Manual GUI Built-in
Jinja2 templating Built-in No No Helm templates
Learning curve Low Low Medium High
Setup complexity Minimal Minimal Medium High

Project Info

Clone this wiki locally