A lightweight Docker Compose orchestrator for single-machine deployments.
Reign manages Docker Compose projects and native binaries on a single Linux server. It replaces manual systemd service files with a unified CLI, REST API, and persistent state management.
- CLI: Manage services from the command line
- REST API: Full control via HTTP endpoints
- Docker Compose Management: Start, stop, restart compose projects
- Native Binary Support: Run standalone binaries with journald logging
- Infrastructure Priority: Start databases and dependencies first
- Automatic Image Pulls: Always pull latest images before starting
- Persistent State: SQLite database tracks all services
- Event Logging: Audit trail of all service operations
- Health Monitoring: Report container status and statistics
- Linux (Debian/Ubuntu recommended)
- Docker with Compose V2 (
docker composecommand) - Go 1.21+ (for building)
make buildcp config.json.sample config.json
# Edit config.json as needed# Development
./run.sh
# Production (as systemd service)
sudo cp reign /usr/local/bin/
sudo cp reign.service /etc/systemd/system/
sudo systemctl enable --now reignOnce the server is running, use the CLI from the same binary:
reign list
reign show myservice
reign start myserviceConfiguration file (config.json):
{
"listenAddr": "127.0.0.1:7890",
"databasePath": "/var/lib/reign/reign.db",
"logLevel": "info"
}| Field | Default | Description |
|---|---|---|
listenAddr |
127.0.0.1:7890 |
HTTP API listen address |
databasePath |
/var/lib/reign/reign.db |
SQLite database location |
logLevel |
info |
Log level: debug, info, warn, error |
The reign binary acts as both the server and the CLI client. When invoked with a subcommand it talks to the running server over HTTP.
| Option | Env Var | Default | Description |
|---|---|---|---|
--server |
REIGN_SERVER |
http://127.0.0.1:7890 |
Server address |
| Command | Aliases | Description |
|---|---|---|
list |
ls, status, ps |
List all services with status |
show |
get |
Show detailed service information |
create |
add |
Create a new service |
update |
set |
Update a service |
delete |
rm, remove |
Delete a service |
start |
Start a service | |
stop |
Stop a service | |
restart |
Restart a service | |
logs |
View service logs | |
enable |
Enable a service | |
disable |
Disable a service | |
serve |
Start the server (default) | |
help |
Show help for a command | |
version |
Show version |
reign list # table output
reign list --json # JSON outputreign show myservice # human-readable details + events
reign show --json myservice # JSON service definition onlyThe --json flag outputs the service definition in a format that can be piped
directly into create or update.
Using flags:
reign create \
--id myapp \
--name "My Application" \
--type compose \
--path /home/tim/myappUsing a JSON file:
reign create -f service.jsonFrom stdin (e.g. clone an existing service):
reign show --json oldservice | jq '.id = "newservice"' | reign create -f -| Flag | Description |
|---|---|
-f, --file |
JSON file with service definition (- for stdin) |
--id |
Service ID (required) |
--name |
Display name (required) |
--type |
compose or binary (required) |
--path |
Path to compose dir or binary (required) |
--command |
Command / arguments for binary services |
--enabled |
true / false (default: true) |
--infrastructure |
true / false (default: false) |
Flags override any values loaded from a JSON file.
reign update myservice --name "New Name"
reign update myservice --enabled false
reign update myservice -f updated.json
reign show --json myservice | jq '.name = "New Name"' | reign update myservice -f -Accepts the same field flags as create (except --id). Only provided fields
are changed.
reign delete myservice # prompts for confirmation
reign delete -f myservice # no confirmationreign start myservice
reign stop myservice
reign restart myservicereign disable myservice # prevents starting
reign enable myservice # allows starting againreign logs myservice # last 100 lines
reign logs -n 50 myservice # last 50 linesGET /healthReturns orchestrator status and summary.
GET /servicesReturns all registered services with their current state.
GET /services/{id}Returns a single service with state and recent events.
POST /services
Content-Type: application/json
{
"id": "bookmarks",
"name": "Shaarli Bookmarks",
"type": "compose",
"path": "/home/tim/bookmarks",
"enabled": true,
"infrastructure": false
}PUT /services/{id}
Content-Type: application/json
{
"name": "Updated Name",
"enabled": false
}DELETE /services/{id}Stops the service if running and removes it from the database.
POST /services/{id}/startPulls images (for compose) and starts the service.
POST /services/{id}/stopGracefully stops the service.
POST /services/{id}/restartStops and starts the service.
GET /services/{id}/logs?lines=100Returns recent logs from the service (compose) or journald (binary).
pathis the directory containingdocker-compose.yml- Reign runs
docker composefrom this directory - Environment files and bind mounts work as expected
pathis the full path to the executable- Stdout/stderr are captured to journald
- Working directory is the binary's parent directory
Services marked as infrastructure: true are started first during boot:
- All infrastructure services start in alphabetical order
- Each must be healthy before the next starts
- Regular services start after all infrastructure is ready
Example: PostgreSQL and Redis as infrastructure, web apps as regular services.
Using the CLI:
# Register a database (infrastructure)
reign create \
--id postgres \
--name "PostgreSQL" \
--type compose \
--path /home/tim/postgres \
--infrastructure true
# Register an application
reign create \
--id myapp \
--name "My Application" \
--type compose \
--path /home/tim/myapp
# Start services
reign start postgres
reign start myapp
# Check status
reign list
# View details
reign show myapp
# Export, tweak, and clone a service
reign show --json myapp | jq '.id = "myapp-staging" | .name = "My App (staging)"' | reign create -f -The same operations via curl:
# Register a database (infrastructure)
curl -X POST http://localhost:7890/services \
-H "Content-Type: application/json" \
-d '{
"id": "postgres",
"name": "PostgreSQL",
"type": "compose",
"path": "/home/tim/postgres",
"infrastructure": true
}'
# Register an application
curl -X POST http://localhost:7890/services \
-H "Content-Type: application/json" \
-d '{
"id": "myapp",
"name": "My Application",
"type": "compose",
"path": "/home/tim/myapp"
}'
# Start all services
curl -X POST http://localhost:7890/services/postgres/start
curl -X POST http://localhost:7890/services/myapp/start
# Check status
curl http://localhost:7890/services- Architecture: System design and component details
- Data Model: Database schema and data structures
- Roadmap: Planned features and future direction
MIT