A CLI tool that simplifies deploying any application to VPS servers.
Minion CLI simplifies the process of deploying containerized applications to VPS servers. It handles Docker image building, transfer, and deployment with automatic SSL certificate management via Traefik.
Before using Minion CLI, ensure you have the following installed on your local machine:
-
Rust (1.70 or later) - For building and installing the CLI
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Docker - For building container images locally
Make sure Docker is running before attempting to deploy.
-
SSH Access - You need SSH key-based authentication to your VPS
- First, ensure your public key is added to the VPS server's
~/.ssh/authorized_keys - Then add your private key to the SSH agent on your local machine:
ssh-add ~/.ssh/id_ed25519 # or ssh-add ~/.ssh/id_rsa
- First, ensure your public key is added to the VPS server's
- Ubuntu/Debian-based VPS (tested on Ubuntu 25.10)
- Root or sudo access
- SSH access configured
Install Minion CLI globally on your system:
# Clone the repository
git clone https://github.com/CaliforniaOpenSource/minion-cli.git
cd minion-cli
# Build the project
cargo build --release
# Install the binary
cargo install --path .This will install the minion command in your PATH.
To verify installation:
minion --versionMinion CLI has three main commands:
Run this once to set up your VPS with Docker and Traefik:
minion setupThis command will:
- Create a
minionuser on the VPS - Install Docker
- Set up Traefik as a reverse proxy
- Configure SSL certificate management with Let's Encrypt
You'll be prompted for:
- VPS hostname or IP address
- Email address for SSL certificates
Run this in your application directory to configure deployment settings:
cd /path/to/your/app
minion initYou'll be prompted for:
- VPS hostname or IP address
- Application name
- Domain/URL (e.g.,
app.example.com) - Port your app listens on (e.g.,
3000)
This creates a .minion configuration file in your project.
Deploy your application to the VPS:
minion deployUse -y or --yes to skip prompts and use values from .minion:
minion deploy -yThis command will:
- Build a Docker image locally
- Save and transfer the image to your VPS
- Create a docker-compose configuration
- Start your application with automatic SSL
Your app will be available at https://app.example.com after deployment completes.
The .minion file stores your deployment configuration:
APP_NAME=my-app
APP_PORT=3000
APP_URL=app.example.com
APP_VOLUMES=
VPS_HOST=167.99.231.125
This file is automatically created by minion init and updated by minion deploy.
To persist data, you can specify volume mappings during deployment:
minion deploy
# When prompted for volumes:
# Enter: data:/app/data,uploads:/app/uploadsOr use minion deploy -y to use the volumes already saved in .minion.
This maps:
/opt/minion/your-app/volumes/dataon VPS →/app/datain container/opt/minion/your-app/volumes/uploadson VPS →/app/uploadsin container
If you see Error: no identities found in the ssh agent:
# Start the SSH agent
eval "$(ssh-agent -s)"
# Add your SSH key
ssh-add ~/.ssh/id_ed25519If you see docker: command not found or connection errors:
- Ensure Docker Desktop is running
- Verify with:
docker ps
If Docker build fails, you can test locally:
docker build -t test-build . --platform=linux/amd64This will show the full error output.