Latest commit

History

1,294 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

DiscordVersionLicense



Build, deploy, and manage containerised applications with a single config file.

Stacker is a platform for turning any project into a deployable Docker stack. Add a stacker.yml to your repo, and Stacker generates Dockerfiles, docker-compose definitions, reverse-proxy configs, and deploys locally or to cloud providers — optionally with AI assistance.

Three components

ComponentWhat it doesBinary
Stacker CLIDeveloper tool — init, deploy, monitor from the terminalstacker-cli
Stacker ServerREST API + Stack Builder UI + deployment orchestration + MCP Serverserver
Status Panel AgentDeployed alongside your app on the target server — executes commands, streams logs, reports health(separate repo)
┌──────────────┐ ┌──────────────────┐ ┌─────────────────────┐
│ Stacker CLI │────────►│ Stacker Server │────────►│ Status Panel Agent │
│ │ REST │ │ queue │ (on target server) │
│ stacker.yml │ API │ Stack Builder UI│ pull │ │
│ init/deploy │ │ 48+ MCP tools │◄────────│ health / logs / │
│ status/logs │ │ Vault · AMQP │ HMAC │ restart / exec / │
└──────────────┘ └──────────────────┘ │ deploy_app / proxy │
│ └─────────────────────┘
▼
Terraform + Ansible ──► Cloud
(Hetzner, DO, AWS, Linode)

Quick Start

Install the CLI

curl -fsSL https://raw.githubusercontent.com/trydirect/stacker/main/install.sh | bash

Create & deploy a project

cd my-project
stacker init # auto-detects project type, generates stacker.yml
stacker deploy # builds and runs locally via docker compose
stacker status # check running containers

AI-powered init (optional)

Stacker can scan your project files and use an LLM to generate a tailored stacker.yml:

# Local AI with Ollama (free, private, default)
stacker init --with-ai
# OpenAI
stacker init --with-ai --ai-provider openai --ai-api-key sk-...
# Anthropic (key from env)export ANTHROPIC_API_KEY=sk-ant-...
stacker init --with-ai --ai-provider anthropic

If the AI provider is unreachable, Stacker falls back to template-based generation automatically.


stacker.yml example

name: my-appapp:
type: nodepath: ./srcports:
- "8080:3000"environment:
NODE_ENV: productionservices:
- name: postgresimage: postgres:16environment:
POSTGRES_DB: myappPOSTGRES_PASSWORD: ${DB_PASSWORD}proxy:
type: nginxauto_detect: truedomains:
- domain: app.example.comssl: autoupstream: app:3000deploy:
target: local # or: cloud, serverai:
enabled: trueprovider: ollamamodel: llama3monitoring:
status_panel: truehealthcheck:
endpoint: /healthinterval: 30s

Full schema reference: docs/STACKER_YML_REFERENCE.md


1. Stacker CLI

The end-user tool. No server required for local deploys.

Commands

CommandDescription
stacker initDetect project type, generate stacker.yml + .stacker/ artifacts
stacker deployBuild & deploy the stack (local, cloud, or server)
stacker statusShow running containers and health
stacker logsView container logs (--follow, --service, --tail)
stacker list deploymentsList deployments on the Stacker server
stacker destroyTear down the deployed stack
stacker config validateValidate stacker.yml syntax
stacker config showShow resolved configuration
stacker config examplePrint a full commented reference
stacker config setup cloudGuided cloud deployment setup
stacker ai ask "question"Ask the AI about your stack
stacker proxy addAdd a reverse-proxy domain entry
stacker proxy detectAuto-detect existing reverse-proxy containers
stacker ssh-key generateGenerate a new SSH key pair for a server (Vault-backed)
stacker ssh-key showDisplay the public SSH key for a server
stacker ssh-key uploadUpload an existing SSH key pair for a server
stacker service addAdd a service from the template catalog to stacker.yml
stacker service listList available service templates (20+ built-in)
stacker agent healthCheck Status Panel agent connectivity and health
stacker agent statusDisplay agent snapshot — containers, versions, uptime
stacker agent logs <app>Retrieve container logs from the remote agent
stacker agent restart <app>Restart a container via the agent
stacker agent deploy-appDeploy or update an app container on the target server
stacker agent remove-appRemove an app container (with optional volume/image cleanup)
stacker agent configure-proxyConfigure Nginx Proxy Manager via the agent
stacker agent historyShow recent command execution history
stacker agent execExecute a raw agent command with JSON parameters
stacker loginAuthenticate with the TryDirect platform
stacker updateCheck for updates and self-update

Deploy targets

stacker deploy --target local# docker compose up (default)
stacker deploy --target cloud # Terraform + Ansible → cloud provider
stacker deploy --target server # deploy to existing server via SSH
stacker deploy --dry-run # preview generated files without executing

Key features

  • Auto-detection — identifies Node, Python, Rust, Go, PHP, static sites from project files
  • Dockerfile generation — produces optimised multi-stage Dockerfiles per app type
  • Docker Compose generation — wires app + services + proxy + monitoring
  • AI-assisted config — scans project, calls LLM to generate tailored stacker.yml
  • AI troubleshooting — on deploy failure, suggests fixes via AI or deterministic fallback hints
  • Service catalog — 20+ built-in service templates (Postgres, Redis, WordPress, etc.) — add with stacker service add
  • AI service addition — ask stacker ai ask --write "add wordpress" and the AI uses the template catalog
  • Agent controlstacker agent subcommand to manage remote Status Panel agents (health, logs, restart, deploy, proxy) with --json output
  • SSH key management — generate, view, and upload server SSH keys (Vault-backed)
  • Reverse proxy — auto-detects Nginx / Nginx Proxy Manager, configures domains + SSL
  • Cloud deployment — Hetzner, DigitalOcean, AWS, Linode

2. Stacker Server

The backend platform powering the Stack Builder UI, REST API, deployment orchestration, and MCP server for AI agents.

Setup

cp configuration.yaml.dist configuration.yaml # edit database, vault, AMQP settings
cp access_control.conf.dist access_control.conf
export DATABASE_URL=postgres://postgres:postgres@localhost:5432/stacker
sqlx migrate run
cargo run --bin server # http://127.0.0.1:8000

Key API endpoints

EndpointDescription
POST /projectCreate a project from a stack definition
POST /{id}/deploy/{cloud_id}Deploy to a cloud provider
GET /project/{id}/appsList apps in a project
PUT /project/{id}/apps/{code}/envUpdate app environment variables
PUT /project/{id}/apps/{code}/portsUpdate port mappings
PUT /project/{id}/apps/{code}/domainUpdate domain / SSL settings
POST /api/v1/commandsEnqueue a command for the Status Panel agent

MCP Server

Stacker exposes 52+ Model Context Protocol tools over WebSocket, enabling AI agents (Claude, GPT, etc.) to manage infrastructure programmatically:

  • Project & deployment management
  • Container operations (start, stop, restart, exec)
  • Log analysis & error summaries
  • Vault config read/write
  • Proxy configuration
  • App environment & port management
  • Server resource monitoring
  • Docker Compose generation & preview
  • Agent control (deploy app, remove app, configure proxy, get status)
  • Firewall management (iptables rules via Status Panel or SSH)

Key integrations

  • HashiCorp Vault — secrets and config storage, synced to deployments
  • RabbitMQ — deployment status updates, event-driven orchestration
  • TryDirect User Service — OAuth, marketplace templates, payment validation
  • Marketplace — publish and deploy community stacks

3. Status Panel Agent

A lightweight agent deployed alongside your application on the target server. It runs as a Docker container and communicates with Stacker Server using a pull-only architecture — the agent polls for commands, Stacker never dials out.

How it works

1. UI/API creates a command → POST /api/v1/commands
2. Command stored in DB queue → commands + command_queue tables
3. Agent polls for work → GET /api/v1/agent/commands/wait/{hash}
4. Agent executes locally → Docker API on the host
5. Agent reports result → POST /api/v1/agent/commands/report

All agent requests are HMAC-signed (X-Agent-Signature header) using a token stored in Vault.

Supported commands

CommandDescription
healthCheck container health status (single or all)
logsFetch container logs (stdout/stderr, with limits)
restartRestart a container
deploy_appDeploy or update an app container
remove_appRemove an app container
configure_proxyCreate/update/delete reverse-proxy entries
configure_firewallConfigure iptables firewall rules (add/remove/list/flush)
stacker.execExecute a command inside a running container (with security blocklist)
stacker.server_resourcesCollect server resource metrics (CPU, memory, disk, network)
apply_configPull config from Vault and apply to a running container

Agent registration

# Agent self-registers on first boot (no auth required)
POST /api/v1/agent/register
{ "deployment_hash": "abc123", "capabilities": [...], "system_info": {...} }
→ { "agent_id": "...", "agent_token": "..." }

Token rotation

cargo run --bin console -- Agent rotate-token \
--deployment-hash <hash> \
--new-token <NEW_TOKEN>

Database migrations

sqlx migrate run # apply
sqlx migrate revert # rollback

Testing

cargo test# all tests (467+)
cargo test user_service_client # User Service connector
cargo test marketplace_webhook # Marketplace webhook flows
cargo test deployment_validator # Deployment validation

Documentation


License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Latest commit

History

1,294 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

DiscordVersionLicense



Build, deploy, and manage containerised applications with a single config file.

Stacker is a platform for turning any project into a deployable Docker stack. Add a stacker.yml to your repo, and Stacker generates Dockerfiles, docker-compose definitions, reverse-proxy configs, and deploys locally or to cloud providers — optionally with AI assistance.

Three components

ComponentWhat it doesBinary
Stacker CLIDeveloper tool — init, deploy, monitor from the terminalstacker-cli
Stacker ServerREST API + Stack Builder UI + deployment orchestration + MCP Serverserver
Status Panel AgentDeployed alongside your app on the target server — executes commands, streams logs, reports health(separate repo)
┌──────────────┐ ┌──────────────────┐ ┌─────────────────────┐
│ Stacker CLI │────────►│ Stacker Server │────────►│ Status Panel Agent │
│ │ REST │ │ queue │ (on target server) │
│ stacker.yml │ API │ Stack Builder UI│ pull │ │
│ init/deploy │ │ 48+ MCP tools │◄────────│ health / logs / │
│ status/logs │ │ Vault · AMQP │ HMAC │ restart / exec / │
└──────────────┘ └──────────────────┘ │ deploy_app / proxy │
│ └─────────────────────┘
▼
Terraform + Ansible ──► Cloud
(Hetzner, DO, AWS, Linode)

Quick Start

Install the CLI

curl -fsSL https://raw.githubusercontent.com/trydirect/stacker/main/install.sh | bash

Create & deploy a project

cd my-project
stacker init # auto-detects project type, generates stacker.yml
stacker deploy # builds and runs locally via docker compose
stacker status # check running containers

AI-powered init (optional)

Stacker can scan your project files and use an LLM to generate a tailored stacker.yml:

# Local AI with Ollama (free, private, default)
stacker init --with-ai
# OpenAI
stacker init --with-ai --ai-provider openai --ai-api-key sk-...
# Anthropic (key from env)export ANTHROPIC_API_KEY=sk-ant-...
stacker init --with-ai --ai-provider anthropic

If the AI provider is unreachable, Stacker falls back to template-based generation automatically.


stacker.yml example

name: my-appapp:
type: nodepath: ./srcports:
- "8080:3000"environment:
NODE_ENV: productionservices:
- name: postgresimage: postgres:16environment:
POSTGRES_DB: myappPOSTGRES_PASSWORD: ${DB_PASSWORD}proxy:
type: nginxauto_detect: truedomains:
- domain: app.example.comssl: autoupstream: app:3000deploy:
target: local # or: cloud, serverai:
enabled: trueprovider: ollamamodel: llama3monitoring:
status_panel: truehealthcheck:
endpoint: /healthinterval: 30s

Full schema reference: docs/STACKER_YML_REFERENCE.md


1. Stacker CLI

The end-user tool. No server required for local deploys.

Commands

CommandDescription
stacker initDetect project type, generate stacker.yml + .stacker/ artifacts
stacker deployBuild & deploy the stack (local, cloud, or server)
stacker statusShow running containers and health
stacker logsView container logs (--follow, --service, --tail)
stacker list deploymentsList deployments on the Stacker server
stacker destroyTear down the deployed stack
stacker config validateValidate stacker.yml syntax
stacker config showShow resolved configuration
stacker config examplePrint a full commented reference
stacker config setup cloudGuided cloud deployment setup
stacker ai ask "question"Ask the AI about your stack
stacker proxy addAdd a reverse-proxy domain entry
stacker proxy detectAuto-detect existing reverse-proxy containers
stacker ssh-key generateGenerate a new SSH key pair for a server (Vault-backed)
stacker ssh-key showDisplay the public SSH key for a server
stacker ssh-key uploadUpload an existing SSH key pair for a server
stacker service addAdd a service from the template catalog to stacker.yml
stacker service listList available service templates (20+ built-in)
stacker agent healthCheck Status Panel agent connectivity and health
stacker agent statusDisplay agent snapshot — containers, versions, uptime
stacker agent logs <app>Retrieve container logs from the remote agent
stacker agent restart <app>Restart a container via the agent
stacker agent deploy-appDeploy or update an app container on the target server
stacker agent remove-appRemove an app container (with optional volume/image cleanup)
stacker agent configure-proxyConfigure Nginx Proxy Manager via the agent
stacker agent historyShow recent command execution history
stacker agent execExecute a raw agent command with JSON parameters
stacker loginAuthenticate with the TryDirect platform
stacker updateCheck for updates and self-update

Deploy targets

stacker deploy --target local# docker compose up (default)
stacker deploy --target cloud # Terraform + Ansible → cloud provider
stacker deploy --target server # deploy to existing server via SSH
stacker deploy --dry-run # preview generated files without executing

Key features

  • Auto-detection — identifies Node, Python, Rust, Go, PHP, static sites from project files
  • Dockerfile generation — produces optimised multi-stage Dockerfiles per app type
  • Docker Compose generation — wires app + services + proxy + monitoring
  • AI-assisted config — scans project, calls LLM to generate tailored stacker.yml
  • AI troubleshooting — on deploy failure, suggests fixes via AI or deterministic fallback hints
  • Service catalog — 20+ built-in service templates (Postgres, Redis, WordPress, etc.) — add with stacker service add
  • AI service addition — ask stacker ai ask --write "add wordpress" and the AI uses the template catalog
  • Agent controlstacker agent subcommand to manage remote Status Panel agents (health, logs, restart, deploy, proxy) with --json output
  • SSH key management — generate, view, and upload server SSH keys (Vault-backed)
  • Reverse proxy — auto-detects Nginx / Nginx Proxy Manager, configures domains + SSL
  • Cloud deployment — Hetzner, DigitalOcean, AWS, Linode

2. Stacker Server

The backend platform powering the Stack Builder UI, REST API, deployment orchestration, and MCP server for AI agents.

Setup

cp configuration.yaml.dist configuration.yaml # edit database, vault, AMQP settings
cp access_control.conf.dist access_control.conf
export DATABASE_URL=postgres://postgres:postgres@localhost:5432/stacker
sqlx migrate run
cargo run --bin server # http://127.0.0.1:8000

Key API endpoints

EndpointDescription
POST /projectCreate a project from a stack definition
POST /{id}/deploy/{cloud_id}Deploy to a cloud provider
GET /project/{id}/appsList apps in a project
PUT /project/{id}/apps/{code}/envUpdate app environment variables
PUT /project/{id}/apps/{code}/portsUpdate port mappings
PUT /project/{id}/apps/{code}/domainUpdate domain / SSL settings
POST /api/v1/commandsEnqueue a command for the Status Panel agent

MCP Server

Stacker exposes 52+ Model Context Protocol tools over WebSocket, enabling AI agents (Claude, GPT, etc.) to manage infrastructure programmatically:

  • Project & deployment management
  • Container operations (start, stop, restart, exec)
  • Log analysis & error summaries
  • Vault config read/write
  • Proxy configuration
  • App environment & port management
  • Server resource monitoring
  • Docker Compose generation & preview
  • Agent control (deploy app, remove app, configure proxy, get status)
  • Firewall management (iptables rules via Status Panel or SSH)

Key integrations

  • HashiCorp Vault — secrets and config storage, synced to deployments
  • RabbitMQ — deployment status updates, event-driven orchestration
  • TryDirect User Service — OAuth, marketplace templates, payment validation
  • Marketplace — publish and deploy community stacks

3. Status Panel Agent

A lightweight agent deployed alongside your application on the target server. It runs as a Docker container and communicates with Stacker Server using a pull-only architecture — the agent polls for commands, Stacker never dials out.

How it works

1. UI/API creates a command → POST /api/v1/commands
2. Command stored in DB queue → commands + command_queue tables
3. Agent polls for work → GET /api/v1/agent/commands/wait/{hash}
4. Agent executes locally → Docker API on the host
5. Agent reports result → POST /api/v1/agent/commands/report

All agent requests are HMAC-signed (X-Agent-Signature header) using a token stored in Vault.

Supported commands

CommandDescription
healthCheck container health status (single or all)
logsFetch container logs (stdout/stderr, with limits)
restartRestart a container
deploy_appDeploy or update an app container
remove_appRemove an app container
configure_proxyCreate/update/delete reverse-proxy entries
configure_firewallConfigure iptables firewall rules (add/remove/list/flush)
stacker.execExecute a command inside a running container (with security blocklist)
stacker.server_resourcesCollect server resource metrics (CPU, memory, disk, network)
apply_configPull config from Vault and apply to a running container

Agent registration

# Agent self-registers on first boot (no auth required)
POST /api/v1/agent/register
{ "deployment_hash": "abc123", "capabilities": [...], "system_info": {...} }
→ { "agent_id": "...", "agent_token": "..." }

Token rotation

cargo run --bin console -- Agent rotate-token \
--deployment-hash <hash> \
--new-token <NEW_TOKEN>

Database migrations

sqlx migrate run # apply
sqlx migrate revert # rollback

Testing

cargo test# all tests (467+)
cargo test user_service_client # User Service connector
cargo test marketplace_webhook # Marketplace webhook flows
cargo test deployment_validator # Deployment validation

Documentation


License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

1,294 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

DiscordVersionLicense



Build, deploy, and manage containerised applications with a single config file.

Stacker is a platform for turning any project into a deployable Docker stack. Add a stacker.yml to your repo, and Stacker generates Dockerfiles, docker-compose definitions, reverse-proxy configs, and deploys locally or to cloud providers — optionally with AI assistance.

Three components

ComponentWhat it doesBinary
Stacker CLIDeveloper tool — init, deploy, monitor from the terminalstacker-cli
Stacker ServerREST API + Stack Builder UI + deployment orchestration + MCP Serverserver
Status Panel AgentDeployed alongside your app on the target server — executes commands, streams logs, reports health(separate repo)
┌──────────────┐ ┌──────────────────┐ ┌─────────────────────┐
│ Stacker CLI │────────►│ Stacker Server │────────►│ Status Panel Agent │
│ │ REST │ │ queue │ (on target server) │
│ stacker.yml │ API │ Stack Builder UI│ pull │ │
│ init/deploy │ │ 48+ MCP tools │◄────────│ health / logs / │
│ status/logs │ │ Vault · AMQP │ HMAC │ restart / exec / │
└──────────────┘ └──────────────────┘ │ deploy_app / proxy │
│ └─────────────────────┘
▼
Terraform + Ansible ──► Cloud
(Hetzner, DO, AWS, Linode)

Quick Start

Install the CLI

curl -fsSL https://raw.githubusercontent.com/trydirect/stacker/main/install.sh | bash

Create & deploy a project

cd my-project
stacker init # auto-detects project type, generates stacker.yml
stacker deploy # builds and runs locally via docker compose
stacker status # check running containers

AI-powered init (optional)

Stacker can scan your project files and use an LLM to generate a tailored stacker.yml:

# Local AI with Ollama (free, private, default)
stacker init --with-ai
# OpenAI
stacker init --with-ai --ai-provider openai --ai-api-key sk-...
# Anthropic (key from env)export ANTHROPIC_API_KEY=sk-ant-...
stacker init --with-ai --ai-provider anthropic

If the AI provider is unreachable, Stacker falls back to template-based generation automatically.


stacker.yml example

name: my-appapp:
type: nodepath: ./srcports:
- "8080:3000"environment:
NODE_ENV: productionservices:
- name: postgresimage: postgres:16environment:
POSTGRES_DB: myappPOSTGRES_PASSWORD: ${DB_PASSWORD}proxy:
type: nginxauto_detect: truedomains:
- domain: app.example.comssl: autoupstream: app:3000deploy:
target: local # or: cloud, serverai:
enabled: trueprovider: ollamamodel: llama3monitoring:
status_panel: truehealthcheck:
endpoint: /healthinterval: 30s

Full schema reference: docs/STACKER_YML_REFERENCE.md


1. Stacker CLI

The end-user tool. No server required for local deploys.

Commands

CommandDescription
stacker initDetect project type, generate stacker.yml + .stacker/ artifacts
stacker deployBuild & deploy the stack (local, cloud, or server)
stacker statusShow running containers and health
stacker logsView container logs (--follow, --service, --tail)
stacker list deploymentsList deployments on the Stacker server
stacker destroyTear down the deployed stack
stacker config validateValidate stacker.yml syntax
stacker config showShow resolved configuration
stacker config examplePrint a full commented reference
stacker config setup cloudGuided cloud deployment setup
stacker ai ask "question"Ask the AI about your stack
stacker proxy addAdd a reverse-proxy domain entry
stacker proxy detectAuto-detect existing reverse-proxy containers
stacker ssh-key generateGenerate a new SSH key pair for a server (Vault-backed)
stacker ssh-key showDisplay the public SSH key for a server
stacker ssh-key uploadUpload an existing SSH key pair for a server
stacker service addAdd a service from the template catalog to stacker.yml
stacker service listList available service templates (20+ built-in)
stacker agent healthCheck Status Panel agent connectivity and health
stacker agent statusDisplay agent snapshot — containers, versions, uptime
stacker agent logs <app>Retrieve container logs from the remote agent
stacker agent restart <app>Restart a container via the agent
stacker agent deploy-appDeploy or update an app container on the target server
stacker agent remove-appRemove an app container (with optional volume/image cleanup)
stacker agent configure-proxyConfigure Nginx Proxy Manager via the agent
stacker agent historyShow recent command execution history
stacker agent execExecute a raw agent command with JSON parameters
stacker loginAuthenticate with the TryDirect platform
stacker updateCheck for updates and self-update

Deploy targets

stacker deploy --target local# docker compose up (default)
stacker deploy --target cloud # Terraform + Ansible → cloud provider
stacker deploy --target server # deploy to existing server via SSH
stacker deploy --dry-run # preview generated files without executing

Key features

  • Auto-detection — identifies Node, Python, Rust, Go, PHP, static sites from project files
  • Dockerfile generation — produces optimised multi-stage Dockerfiles per app type
  • Docker Compose generation — wires app + services + proxy + monitoring
  • AI-assisted config — scans project, calls LLM to generate tailored stacker.yml
  • AI troubleshooting — on deploy failure, suggests fixes via AI or deterministic fallback hints
  • Service catalog — 20+ built-in service templates (Postgres, Redis, WordPress, etc.) — add with stacker service add
  • AI service addition — ask stacker ai ask --write "add wordpress" and the AI uses the template catalog
  • Agent controlstacker agent subcommand to manage remote Status Panel agents (health, logs, restart, deploy, proxy) with --json output
  • SSH key management — generate, view, and upload server SSH keys (Vault-backed)
  • Reverse proxy — auto-detects Nginx / Nginx Proxy Manager, configures domains + SSL
  • Cloud deployment — Hetzner, DigitalOcean, AWS, Linode

2. Stacker Server

The backend platform powering the Stack Builder UI, REST API, deployment orchestration, and MCP server for AI agents.

Setup

cp configuration.yaml.dist configuration.yaml # edit database, vault, AMQP settings
cp access_control.conf.dist access_control.conf
export DATABASE_URL=postgres://postgres:postgres@localhost:5432/stacker
sqlx migrate run
cargo run --bin server # http://127.0.0.1:8000

Key API endpoints

EndpointDescription
POST /projectCreate a project from a stack definition
POST /{id}/deploy/{cloud_id}Deploy to a cloud provider
GET /project/{id}/appsList apps in a project
PUT /project/{id}/apps/{code}/envUpdate app environment variables
PUT /project/{id}/apps/{code}/portsUpdate port mappings
PUT /project/{id}/apps/{code}/domainUpdate domain / SSL settings
POST /api/v1/commandsEnqueue a command for the Status Panel agent

MCP Server

Stacker exposes 52+ Model Context Protocol tools over WebSocket, enabling AI agents (Claude, GPT, etc.) to manage infrastructure programmatically:

  • Project & deployment management
  • Container operations (start, stop, restart, exec)
  • Log analysis & error summaries
  • Vault config read/write
  • Proxy configuration
  • App environment & port management
  • Server resource monitoring
  • Docker Compose generation & preview
  • Agent control (deploy app, remove app, configure proxy, get status)
  • Firewall management (iptables rules via Status Panel or SSH)

Key integrations

  • HashiCorp Vault — secrets and config storage, synced to deployments
  • RabbitMQ — deployment status updates, event-driven orchestration
  • TryDirect User Service — OAuth, marketplace templates, payment validation
  • Marketplace — publish and deploy community stacks

3. Status Panel Agent

A lightweight agent deployed alongside your application on the target server. It runs as a Docker container and communicates with Stacker Server using a pull-only architecture — the agent polls for commands, Stacker never dials out.

How it works

1. UI/API creates a command → POST /api/v1/commands
2. Command stored in DB queue → commands + command_queue tables
3. Agent polls for work → GET /api/v1/agent/commands/wait/{hash}
4. Agent executes locally → Docker API on the host
5. Agent reports result → POST /api/v1/agent/commands/report

All agent requests are HMAC-signed (X-Agent-Signature header) using a token stored in Vault.

Supported commands

CommandDescription
healthCheck container health status (single or all)
logsFetch container logs (stdout/stderr, with limits)
restartRestart a container
deploy_appDeploy or update an app container
remove_appRemove an app container
configure_proxyCreate/update/delete reverse-proxy entries
configure_firewallConfigure iptables firewall rules (add/remove/list/flush)
stacker.execExecute a command inside a running container (with security blocklist)
stacker.server_resourcesCollect server resource metrics (CPU, memory, disk, network)
apply_configPull config from Vault and apply to a running container

Agent registration

# Agent self-registers on first boot (no auth required)
POST /api/v1/agent/register
{ "deployment_hash": "abc123", "capabilities": [...], "system_info": {...} }
→ { "agent_id": "...", "agent_token": "..." }

Token rotation

cargo run --bin console -- Agent rotate-token \
--deployment-hash <hash> \
--new-token <NEW_TOKEN>

Database migrations

sqlx migrate run # apply
sqlx migrate revert # rollback

Testing

cargo test# all tests (467+)
cargo test user_service_client # User Service connector
cargo test marketplace_webhook # Marketplace webhook flows
cargo test deployment_validator # Deployment validation

Documentation


License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

1,294 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

DiscordVersionLicense



Build, deploy, and manage containerised applications with a single config file.

Stacker is a platform for turning any project into a deployable Docker stack. Add a stacker.yml to your repo, and Stacker generates Dockerfiles, docker-compose definitions, reverse-proxy configs, and deploys locally or to cloud providers — optionally with AI assistance.

Three components

ComponentWhat it doesBinary
Stacker CLIDeveloper tool — init, deploy, monitor from the terminalstacker-cli
Stacker ServerREST API + Stack Builder UI + deployment orchestration + MCP Serverserver
Status Panel AgentDeployed alongside your app on the target server — executes commands, streams logs, reports health(separate repo)
┌──────────────┐ ┌──────────────────┐ ┌─────────────────────┐
│ Stacker CLI │────────►│ Stacker Server │────────►│ Status Panel Agent │
│ │ REST │ │ queue │ (on target server) │
│ stacker.yml │ API │ Stack Builder UI│ pull │ │
│ init/deploy │ │ 48+ MCP tools │◄────────│ health / logs / │
│ status/logs │ │ Vault · AMQP │ HMAC │ restart / exec / │
└──────────────┘ └──────────────────┘ │ deploy_app / proxy │
│ └─────────────────────┘
▼
Terraform + Ansible ──► Cloud
(Hetzner, DO, AWS, Linode)

Quick Start

Install the CLI

curl -fsSL https://raw.githubusercontent.com/trydirect/stacker/main/install.sh | bash

Create & deploy a project

cd my-project
stacker init # auto-detects project type, generates stacker.yml
stacker deploy # builds and runs locally via docker compose
stacker status # check running containers

AI-powered init (optional)

Stacker can scan your project files and use an LLM to generate a tailored stacker.yml:

# Local AI with Ollama (free, private, default)
stacker init --with-ai
# OpenAI
stacker init --with-ai --ai-provider openai --ai-api-key sk-...
# Anthropic (key from env)export ANTHROPIC_API_KEY=sk-ant-...
stacker init --with-ai --ai-provider anthropic

If the AI provider is unreachable, Stacker falls back to template-based generation automatically.


stacker.yml example

name: my-appapp:
type: nodepath: ./srcports:
- "8080:3000"environment:
NODE_ENV: productionservices:
- name: postgresimage: postgres:16environment:
POSTGRES_DB: myappPOSTGRES_PASSWORD: ${DB_PASSWORD}proxy:
type: nginxauto_detect: truedomains:
- domain: app.example.comssl: autoupstream: app:3000deploy:
target: local # or: cloud, serverai:
enabled: trueprovider: ollamamodel: llama3monitoring:
status_panel: truehealthcheck:
endpoint: /healthinterval: 30s

Full schema reference: docs/STACKER_YML_REFERENCE.md


1. Stacker CLI

The end-user tool. No server required for local deploys.

Commands

CommandDescription
stacker initDetect project type, generate stacker.yml + .stacker/ artifacts
stacker deployBuild & deploy the stack (local, cloud, or server)
stacker statusShow running containers and health
stacker logsView container logs (--follow, --service, --tail)
stacker list deploymentsList deployments on the Stacker server
stacker destroyTear down the deployed stack
stacker config validateValidate stacker.yml syntax
stacker config showShow resolved configuration
stacker config examplePrint a full commented reference
stacker config setup cloudGuided cloud deployment setup
stacker ai ask "question"Ask the AI about your stack
stacker proxy addAdd a reverse-proxy domain entry
stacker proxy detectAuto-detect existing reverse-proxy containers
stacker ssh-key generateGenerate a new SSH key pair for a server (Vault-backed)
stacker ssh-key showDisplay the public SSH key for a server
stacker ssh-key uploadUpload an existing SSH key pair for a server
stacker service addAdd a service from the template catalog to stacker.yml
stacker service listList available service templates (20+ built-in)
stacker agent healthCheck Status Panel agent connectivity and health
stacker agent statusDisplay agent snapshot — containers, versions, uptime
stacker agent logs <app>Retrieve container logs from the remote agent
stacker agent restart <app>Restart a container via the agent
stacker agent deploy-appDeploy or update an app container on the target server
stacker agent remove-appRemove an app container (with optional volume/image cleanup)
stacker agent configure-proxyConfigure Nginx Proxy Manager via the agent
stacker agent historyShow recent command execution history
stacker agent execExecute a raw agent command with JSON parameters
stacker loginAuthenticate with the TryDirect platform
stacker updateCheck for updates and self-update

Deploy targets

stacker deploy --target local# docker compose up (default)
stacker deploy --target cloud # Terraform + Ansible → cloud provider
stacker deploy --target server # deploy to existing server via SSH
stacker deploy --dry-run # preview generated files without executing

Key features

  • Auto-detection — identifies Node, Python, Rust, Go, PHP, static sites from project files
  • Dockerfile generation — produces optimised multi-stage Dockerfiles per app type
  • Docker Compose generation — wires app + services + proxy + monitoring
  • AI-assisted config — scans project, calls LLM to generate tailored stacker.yml
  • AI troubleshooting — on deploy failure, suggests fixes via AI or deterministic fallback hints
  • Service catalog — 20+ built-in service templates (Postgres, Redis, WordPress, etc.) — add with stacker service add
  • AI service addition — ask stacker ai ask --write "add wordpress" and the AI uses the template catalog
  • Agent controlstacker agent subcommand to manage remote Status Panel agents (health, logs, restart, deploy, proxy) with --json output
  • SSH key management — generate, view, and upload server SSH keys (Vault-backed)
  • Reverse proxy — auto-detects Nginx / Nginx Proxy Manager, configures domains + SSL
  • Cloud deployment — Hetzner, DigitalOcean, AWS, Linode

2. Stacker Server

The backend platform powering the Stack Builder UI, REST API, deployment orchestration, and MCP server for AI agents.

Setup

cp configuration.yaml.dist configuration.yaml # edit database, vault, AMQP settings
cp access_control.conf.dist access_control.conf
export DATABASE_URL=postgres://postgres:postgres@localhost:5432/stacker
sqlx migrate run
cargo run --bin server # http://127.0.0.1:8000

Key API endpoints

EndpointDescription
POST /projectCreate a project from a stack definition
POST /{id}/deploy/{cloud_id}Deploy to a cloud provider
GET /project/{id}/appsList apps in a project
PUT /project/{id}/apps/{code}/envUpdate app environment variables
PUT /project/{id}/apps/{code}/portsUpdate port mappings
PUT /project/{id}/apps/{code}/domainUpdate domain / SSL settings
POST /api/v1/commandsEnqueue a command for the Status Panel agent

MCP Server

Stacker exposes 52+ Model Context Protocol tools over WebSocket, enabling AI agents (Claude, GPT, etc.) to manage infrastructure programmatically:

  • Project & deployment management
  • Container operations (start, stop, restart, exec)
  • Log analysis & error summaries
  • Vault config read/write
  • Proxy configuration
  • App environment & port management
  • Server resource monitoring
  • Docker Compose generation & preview
  • Agent control (deploy app, remove app, configure proxy, get status)
  • Firewall management (iptables rules via Status Panel or SSH)

Key integrations

  • HashiCorp Vault — secrets and config storage, synced to deployments
  • RabbitMQ — deployment status updates, event-driven orchestration
  • TryDirect User Service — OAuth, marketplace templates, payment validation
  • Marketplace — publish and deploy community stacks

3. Status Panel Agent

A lightweight agent deployed alongside your application on the target server. It runs as a Docker container and communicates with Stacker Server using a pull-only architecture — the agent polls for commands, Stacker never dials out.

How it works

1. UI/API creates a command → POST /api/v1/commands
2. Command stored in DB queue → commands + command_queue tables
3. Agent polls for work → GET /api/v1/agent/commands/wait/{hash}
4. Agent executes locally → Docker API on the host
5. Agent reports result → POST /api/v1/agent/commands/report

All agent requests are HMAC-signed (X-Agent-Signature header) using a token stored in Vault.

Supported commands

CommandDescription
healthCheck container health status (single or all)
logsFetch container logs (stdout/stderr, with limits)
restartRestart a container
deploy_appDeploy or update an app container
remove_appRemove an app container
configure_proxyCreate/update/delete reverse-proxy entries
configure_firewallConfigure iptables firewall rules (add/remove/list/flush)
stacker.execExecute a command inside a running container (with security blocklist)
stacker.server_resourcesCollect server resource metrics (CPU, memory, disk, network)
apply_configPull config from Vault and apply to a running container

Agent registration

# Agent self-registers on first boot (no auth required)
POST /api/v1/agent/register
{ "deployment_hash": "abc123", "capabilities": [...], "system_info": {...} }
→ { "agent_id": "...", "agent_token": "..." }

Token rotation

cargo run --bin console -- Agent rotate-token \
--deployment-hash <hash> \
--new-token <NEW_TOKEN>

Database migrations

sqlx migrate run # apply
sqlx migrate revert # rollback

Testing

cargo test# all tests (467+)
cargo test user_service_client # User Service connector
cargo test marketplace_webhook # Marketplace webhook flows
cargo test deployment_validator # Deployment validation

Documentation


License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Latest commit

History

1,294 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

DiscordVersionLicense



Build, deploy, and manage containerised applications with a single config file.

Stacker is a platform for turning any project into a deployable Docker stack. Add a stacker.yml to your repo, and Stacker generates Dockerfiles, docker-compose definitions, reverse-proxy configs, and deploys locally or to cloud providers — optionally with AI assistance.

Three components

ComponentWhat it doesBinary
Stacker CLIDeveloper tool — init, deploy, monitor from the terminalstacker-cli
Stacker ServerREST API + Stack Builder UI + deployment orchestration + MCP Serverserver
Status Panel AgentDeployed alongside your app on the target server — executes commands, streams logs, reports health(separate repo)
┌──────────────┐ ┌──────────────────┐ ┌─────────────────────┐
│ Stacker CLI │────────►│ Stacker Server │────────►│ Status Panel Agent │
│ │ REST │ │ queue │ (on target server) │
│ stacker.yml │ API │ Stack Builder UI│ pull │ │
│ init/deploy │ │ 48+ MCP tools │◄────────│ health / logs / │
│ status/logs │ │ Vault · AMQP │ HMAC │ restart / exec / │
└──────────────┘ └──────────────────┘ │ deploy_app / proxy │
│ └─────────────────────┘
▼
Terraform + Ansible ──► Cloud
(Hetzner, DO, AWS, Linode)

Quick Start

Install the CLI

curl -fsSL https://raw.githubusercontent.com/trydirect/stacker/main/install.sh | bash

Create & deploy a project

cd my-project
stacker init # auto-detects project type, generates stacker.yml
stacker deploy # builds and runs locally via docker compose
stacker status # check running containers

AI-powered init (optional)

Stacker can scan your project files and use an LLM to generate a tailored stacker.yml:

# Local AI with Ollama (free, private, default)
stacker init --with-ai
# OpenAI
stacker init --with-ai --ai-provider openai --ai-api-key sk-...
# Anthropic (key from env)export ANTHROPIC_API_KEY=sk-ant-...
stacker init --with-ai --ai-provider anthropic

If the AI provider is unreachable, Stacker falls back to template-based generation automatically.


stacker.yml example

name: my-appapp:
type: nodepath: ./srcports:
- "8080:3000"environment:
NODE_ENV: productionservices:
- name: postgresimage: postgres:16environment:
POSTGRES_DB: myappPOSTGRES_PASSWORD: ${DB_PASSWORD}proxy:
type: nginxauto_detect: truedomains:
- domain: app.example.comssl: autoupstream: app:3000deploy:
target: local # or: cloud, serverai:
enabled: trueprovider: ollamamodel: llama3monitoring:
status_panel: truehealthcheck:
endpoint: /healthinterval: 30s

Full schema reference: docs/STACKER_YML_REFERENCE.md


1. Stacker CLI

The end-user tool. No server required for local deploys.

Commands

CommandDescription
stacker initDetect project type, generate stacker.yml + .stacker/ artifacts
stacker deployBuild & deploy the stack (local, cloud, or server)
stacker statusShow running containers and health
stacker logsView container logs (--follow, --service, --tail)
stacker list deploymentsList deployments on the Stacker server
stacker destroyTear down the deployed stack
stacker config validateValidate stacker.yml syntax
stacker config showShow resolved configuration
stacker config examplePrint a full commented reference
stacker config setup cloudGuided cloud deployment setup
stacker ai ask "question"Ask the AI about your stack
stacker proxy addAdd a reverse-proxy domain entry
stacker proxy detectAuto-detect existing reverse-proxy containers
stacker ssh-key generateGenerate a new SSH key pair for a server (Vault-backed)
stacker ssh-key showDisplay the public SSH key for a server
stacker ssh-key uploadUpload an existing SSH key pair for a server
stacker service addAdd a service from the template catalog to stacker.yml
stacker service listList available service templates (20+ built-in)
stacker agent healthCheck Status Panel agent connectivity and health
stacker agent statusDisplay agent snapshot — containers, versions, uptime
stacker agent logs <app>Retrieve container logs from the remote agent
stacker agent restart <app>Restart a container via the agent
stacker agent deploy-appDeploy or update an app container on the target server
stacker agent remove-appRemove an app container (with optional volume/image cleanup)
stacker agent configure-proxyConfigure Nginx Proxy Manager via the agent
stacker agent historyShow recent command execution history
stacker agent execExecute a raw agent command with JSON parameters
stacker loginAuthenticate with the TryDirect platform
stacker updateCheck for updates and self-update

Deploy targets

stacker deploy --target local# docker compose up (default)
stacker deploy --target cloud # Terraform + Ansible → cloud provider
stacker deploy --target server # deploy to existing server via SSH
stacker deploy --dry-run # preview generated files without executing

Key features

  • Auto-detection — identifies Node, Python, Rust, Go, PHP, static sites from project files
  • Dockerfile generation — produces optimised multi-stage Dockerfiles per app type
  • Docker Compose generation — wires app + services + proxy + monitoring
  • AI-assisted config — scans project, calls LLM to generate tailored stacker.yml
  • AI troubleshooting — on deploy failure, suggests fixes via AI or deterministic fallback hints
  • Service catalog — 20+ built-in service templates (Postgres, Redis, WordPress, etc.) — add with stacker service add
  • AI service addition — ask stacker ai ask --write "add wordpress" and the AI uses the template catalog
  • Agent controlstacker agent subcommand to manage remote Status Panel agents (health, logs, restart, deploy, proxy) with --json output
  • SSH key management — generate, view, and upload server SSH keys (Vault-backed)
  • Reverse proxy — auto-detects Nginx / Nginx Proxy Manager, configures domains + SSL
  • Cloud deployment — Hetzner, DigitalOcean, AWS, Linode

2. Stacker Server

The backend platform powering the Stack Builder UI, REST API, deployment orchestration, and MCP server for AI agents.

Setup

cp configuration.yaml.dist configuration.yaml # edit database, vault, AMQP settings
cp access_control.conf.dist access_control.conf
export DATABASE_URL=postgres://postgres:postgres@localhost:5432/stacker
sqlx migrate run
cargo run --bin server # http://127.0.0.1:8000

Key API endpoints

EndpointDescription
POST /projectCreate a project from a stack definition
POST /{id}/deploy/{cloud_id}Deploy to a cloud provider
GET /project/{id}/appsList apps in a project
PUT /project/{id}/apps/{code}/envUpdate app environment variables
PUT /project/{id}/apps/{code}/portsUpdate port mappings
PUT /project/{id}/apps/{code}/domainUpdate domain / SSL settings
POST /api/v1/commandsEnqueue a command for the Status Panel agent

MCP Server

Stacker exposes 52+ Model Context Protocol tools over WebSocket, enabling AI agents (Claude, GPT, etc.) to manage infrastructure programmatically:

  • Project & deployment management
  • Container operations (start, stop, restart, exec)
  • Log analysis & error summaries
  • Vault config read/write
  • Proxy configuration
  • App environment & port management
  • Server resource monitoring
  • Docker Compose generation & preview
  • Agent control (deploy app, remove app, configure proxy, get status)
  • Firewall management (iptables rules via Status Panel or SSH)

Key integrations

  • HashiCorp Vault — secrets and config storage, synced to deployments
  • RabbitMQ — deployment status updates, event-driven orchestration
  • TryDirect User Service — OAuth, marketplace templates, payment validation
  • Marketplace — publish and deploy community stacks

3. Status Panel Agent

A lightweight agent deployed alongside your application on the target server. It runs as a Docker container and communicates with Stacker Server using a pull-only architecture — the agent polls for commands, Stacker never dials out.

How it works

1. UI/API creates a command → POST /api/v1/commands
2. Command stored in DB queue → commands + command_queue tables
3. Agent polls for work → GET /api/v1/agent/commands/wait/{hash}
4. Agent executes locally → Docker API on the host
5. Agent reports result → POST /api/v1/agent/commands/report

All agent requests are HMAC-signed (X-Agent-Signature header) using a token stored in Vault.

Supported commands

CommandDescription
healthCheck container health status (single or all)
logsFetch container logs (stdout/stderr, with limits)
restartRestart a container
deploy_appDeploy or update an app container
remove_appRemove an app container
configure_proxyCreate/update/delete reverse-proxy entries
configure_firewallConfigure iptables firewall rules (add/remove/list/flush)
stacker.execExecute a command inside a running container (with security blocklist)
stacker.server_resourcesCollect server resource metrics (CPU, memory, disk, network)
apply_configPull config from Vault and apply to a running container

Agent registration

# Agent self-registers on first boot (no auth required)
POST /api/v1/agent/register
{ "deployment_hash": "abc123", "capabilities": [...], "system_info": {...} }
→ { "agent_id": "...", "agent_token": "..." }

Token rotation

cargo run --bin console -- Agent rotate-token \
--deployment-hash <hash> \
--new-token <NEW_TOKEN>

Database migrations

sqlx migrate run # apply
sqlx migrate revert # rollback

Testing

cargo test# all tests (467+)
cargo test user_service_client # User Service connector
cargo test marketplace_webhook # Marketplace webhook flows
cargo test deployment_validator # Deployment validation

Documentation


License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

1,294 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

DiscordVersionLicense



Build, deploy, and manage containerised applications with a single config file.

Stacker is a platform for turning any project into a deployable Docker stack. Add a stacker.yml to your repo, and Stacker generates Dockerfiles, docker-compose definitions, reverse-proxy configs, and deploys locally or to cloud providers — optionally with AI assistance.

Three components

ComponentWhat it doesBinary
Stacker CLIDeveloper tool — init, deploy, monitor from the terminalstacker-cli
Stacker ServerREST API + Stack Builder UI + deployment orchestration + MCP Serverserver
Status Panel AgentDeployed alongside your app on the target server — executes commands, streams logs, reports health(separate repo)
┌──────────────┐ ┌──────────────────┐ ┌─────────────────────┐
│ Stacker CLI │────────►│ Stacker Server │────────►│ Status Panel Agent │
│ │ REST │ │ queue │ (on target server) │
│ stacker.yml │ API │ Stack Builder UI│ pull │ │
│ init/deploy │ │ 48+ MCP tools │◄────────│ health / logs / │
│ status/logs │ │ Vault · AMQP │ HMAC │ restart / exec / │
└──────────────┘ └──────────────────┘ │ deploy_app / proxy │
│ └─────────────────────┘
▼
Terraform + Ansible ──► Cloud
(Hetzner, DO, AWS, Linode)

Quick Start

Install the CLI

curl -fsSL https://raw.githubusercontent.com/trydirect/stacker/main/install.sh | bash

Create & deploy a project

cd my-project
stacker init # auto-detects project type, generates stacker.yml
stacker deploy # builds and runs locally via docker compose
stacker status # check running containers

AI-powered init (optional)

Stacker can scan your project files and use an LLM to generate a tailored stacker.yml:

# Local AI with Ollama (free, private, default)
stacker init --with-ai
# OpenAI
stacker init --with-ai --ai-provider openai --ai-api-key sk-...
# Anthropic (key from env)export ANTHROPIC_API_KEY=sk-ant-...
stacker init --with-ai --ai-provider anthropic

If the AI provider is unreachable, Stacker falls back to template-based generation automatically.


stacker.yml example

name: my-appapp:
type: nodepath: ./srcports:
- "8080:3000"environment:
NODE_ENV: productionservices:
- name: postgresimage: postgres:16environment:
POSTGRES_DB: myappPOSTGRES_PASSWORD: ${DB_PASSWORD}proxy:
type: nginxauto_detect: truedomains:
- domain: app.example.comssl: autoupstream: app:3000deploy:
target: local # or: cloud, serverai:
enabled: trueprovider: ollamamodel: llama3monitoring:
status_panel: truehealthcheck:
endpoint: /healthinterval: 30s

Full schema reference: docs/STACKER_YML_REFERENCE.md


1. Stacker CLI

The end-user tool. No server required for local deploys.

Commands

CommandDescription
stacker initDetect project type, generate stacker.yml + .stacker/ artifacts
stacker deployBuild & deploy the stack (local, cloud, or server)
stacker statusShow running containers and health
stacker logsView container logs (--follow, --service, --tail)
stacker list deploymentsList deployments on the Stacker server
stacker destroyTear down the deployed stack
stacker config validateValidate stacker.yml syntax
stacker config showShow resolved configuration
stacker config examplePrint a full commented reference
stacker config setup cloudGuided cloud deployment setup
stacker ai ask "question"Ask the AI about your stack
stacker proxy addAdd a reverse-proxy domain entry
stacker proxy detectAuto-detect existing reverse-proxy containers
stacker ssh-key generateGenerate a new SSH key pair for a server (Vault-backed)
stacker ssh-key showDisplay the public SSH key for a server
stacker ssh-key uploadUpload an existing SSH key pair for a server
stacker service addAdd a service from the template catalog to stacker.yml
stacker service listList available service templates (20+ built-in)
stacker agent healthCheck Status Panel agent connectivity and health
stacker agent statusDisplay agent snapshot — containers, versions, uptime
stacker agent logs <app>Retrieve container logs from the remote agent
stacker agent restart <app>Restart a container via the agent
stacker agent deploy-appDeploy or update an app container on the target server
stacker agent remove-appRemove an app container (with optional volume/image cleanup)
stacker agent configure-proxyConfigure Nginx Proxy Manager via the agent
stacker agent historyShow recent command execution history
stacker agent execExecute a raw agent command with JSON parameters
stacker loginAuthenticate with the TryDirect platform
stacker updateCheck for updates and self-update

Deploy targets

stacker deploy --target local# docker compose up (default)
stacker deploy --target cloud # Terraform + Ansible → cloud provider
stacker deploy --target server # deploy to existing server via SSH
stacker deploy --dry-run # preview generated files without executing

Key features

  • Auto-detection — identifies Node, Python, Rust, Go, PHP, static sites from project files
  • Dockerfile generation — produces optimised multi-stage Dockerfiles per app type
  • Docker Compose generation — wires app + services + proxy + monitoring
  • AI-assisted config — scans project, calls LLM to generate tailored stacker.yml
  • AI troubleshooting — on deploy failure, suggests fixes via AI or deterministic fallback hints
  • Service catalog — 20+ built-in service templates (Postgres, Redis, WordPress, etc.) — add with stacker service add
  • AI service addition — ask stacker ai ask --write "add wordpress" and the AI uses the template catalog
  • Agent controlstacker agent subcommand to manage remote Status Panel agents (health, logs, restart, deploy, proxy) with --json output
  • SSH key management — generate, view, and upload server SSH keys (Vault-backed)
  • Reverse proxy — auto-detects Nginx / Nginx Proxy Manager, configures domains + SSL
  • Cloud deployment — Hetzner, DigitalOcean, AWS, Linode

2. Stacker Server

The backend platform powering the Stack Builder UI, REST API, deployment orchestration, and MCP server for AI agents.

Setup

cp configuration.yaml.dist configuration.yaml # edit database, vault, AMQP settings
cp access_control.conf.dist access_control.conf
export DATABASE_URL=postgres://postgres:postgres@localhost:5432/stacker
sqlx migrate run
cargo run --bin server # http://127.0.0.1:8000

Key API endpoints

EndpointDescription
POST /projectCreate a project from a stack definition
POST /{id}/deploy/{cloud_id}Deploy to a cloud provider
GET /project/{id}/appsList apps in a project
PUT /project/{id}/apps/{code}/envUpdate app environment variables
PUT /project/{id}/apps/{code}/portsUpdate port mappings
PUT /project/{id}/apps/{code}/domainUpdate domain / SSL settings
POST /api/v1/commandsEnqueue a command for the Status Panel agent

MCP Server

Stacker exposes 52+ Model Context Protocol tools over WebSocket, enabling AI agents (Claude, GPT, etc.) to manage infrastructure programmatically:

  • Project & deployment management
  • Container operations (start, stop, restart, exec)
  • Log analysis & error summaries
  • Vault config read/write
  • Proxy configuration
  • App environment & port management
  • Server resource monitoring
  • Docker Compose generation & preview
  • Agent control (deploy app, remove app, configure proxy, get status)
  • Firewall management (iptables rules via Status Panel or SSH)

Key integrations

  • HashiCorp Vault — secrets and config storage, synced to deployments
  • RabbitMQ — deployment status updates, event-driven orchestration
  • TryDirect User Service — OAuth, marketplace templates, payment validation
  • Marketplace — publish and deploy community stacks

3. Status Panel Agent

A lightweight agent deployed alongside your application on the target server. It runs as a Docker container and communicates with Stacker Server using a pull-only architecture — the agent polls for commands, Stacker never dials out.

How it works

1. UI/API creates a command → POST /api/v1/commands
2. Command stored in DB queue → commands + command_queue tables
3. Agent polls for work → GET /api/v1/agent/commands/wait/{hash}
4. Agent executes locally → Docker API on the host
5. Agent reports result → POST /api/v1/agent/commands/report

All agent requests are HMAC-signed (X-Agent-Signature header) using a token stored in Vault.

Supported commands

CommandDescription
healthCheck container health status (single or all)
logsFetch container logs (stdout/stderr, with limits)
restartRestart a container
deploy_appDeploy or update an app container
remove_appRemove an app container
configure_proxyCreate/update/delete reverse-proxy entries
configure_firewallConfigure iptables firewall rules (add/remove/list/flush)
stacker.execExecute a command inside a running container (with security blocklist)
stacker.server_resourcesCollect server resource metrics (CPU, memory, disk, network)
apply_configPull config from Vault and apply to a running container

Agent registration

# Agent self-registers on first boot (no auth required)
POST /api/v1/agent/register
{ "deployment_hash": "abc123", "capabilities": [...], "system_info": {...} }
→ { "agent_id": "...", "agent_token": "..." }

Token rotation

cargo run --bin console -- Agent rotate-token \
--deployment-hash <hash> \
--new-token <NEW_TOKEN>

Database migrations

sqlx migrate run # apply
sqlx migrate revert # rollback

Testing

cargo test# all tests (467+)
cargo test user_service_client # User Service connector
cargo test marketplace_webhook # Marketplace webhook flows
cargo test deployment_validator # Deployment validation

Documentation


License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

1,294 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

DiscordVersionLicense



Build, deploy, and manage containerised applications with a single config file.

Stacker is a platform for turning any project into a deployable Docker stack. Add a stacker.yml to your repo, and Stacker generates Dockerfiles, docker-compose definitions, reverse-proxy configs, and deploys locally or to cloud providers — optionally with AI assistance.

Three components

ComponentWhat it doesBinary
Stacker CLIDeveloper tool — init, deploy, monitor from the terminalstacker-cli
Stacker ServerREST API + Stack Builder UI + deployment orchestration + MCP Serverserver
Status Panel AgentDeployed alongside your app on the target server — executes commands, streams logs, reports health(separate repo)
┌──────────────┐ ┌──────────────────┐ ┌─────────────────────┐
│ Stacker CLI │────────►│ Stacker Server │────────►│ Status Panel Agent │
│ │ REST │ │ queue │ (on target server) │
│ stacker.yml │ API │ Stack Builder UI│ pull │ │
│ init/deploy │ │ 48+ MCP tools │◄────────│ health / logs / │
│ status/logs │ │ Vault · AMQP │ HMAC │ restart / exec / │
└──────────────┘ └──────────────────┘ │ deploy_app / proxy │
│ └─────────────────────┘
▼
Terraform + Ansible ──► Cloud
(Hetzner, DO, AWS, Linode)

Quick Start

Install the CLI

curl -fsSL https://raw.githubusercontent.com/trydirect/stacker/main/install.sh | bash

Create & deploy a project

cd my-project
stacker init # auto-detects project type, generates stacker.yml
stacker deploy # builds and runs locally via docker compose
stacker status # check running containers

AI-powered init (optional)

Stacker can scan your project files and use an LLM to generate a tailored stacker.yml:

# Local AI with Ollama (free, private, default)
stacker init --with-ai
# OpenAI
stacker init --with-ai --ai-provider openai --ai-api-key sk-...
# Anthropic (key from env)export ANTHROPIC_API_KEY=sk-ant-...
stacker init --with-ai --ai-provider anthropic

If the AI provider is unreachable, Stacker falls back to template-based generation automatically.


stacker.yml example

name: my-appapp:
type: nodepath: ./srcports:
- "8080:3000"environment:
NODE_ENV: productionservices:
- name: postgresimage: postgres:16environment:
POSTGRES_DB: myappPOSTGRES_PASSWORD: ${DB_PASSWORD}proxy:
type: nginxauto_detect: truedomains:
- domain: app.example.comssl: autoupstream: app:3000deploy:
target: local # or: cloud, serverai:
enabled: trueprovider: ollamamodel: llama3monitoring:
status_panel: truehealthcheck:
endpoint: /healthinterval: 30s

Full schema reference: docs/STACKER_YML_REFERENCE.md


1. Stacker CLI

The end-user tool. No server required for local deploys.

Commands

CommandDescription
stacker initDetect project type, generate stacker.yml + .stacker/ artifacts
stacker deployBuild & deploy the stack (local, cloud, or server)
stacker statusShow running containers and health
stacker logsView container logs (--follow, --service, --tail)
stacker list deploymentsList deployments on the Stacker server
stacker destroyTear down the deployed stack
stacker config validateValidate stacker.yml syntax
stacker config showShow resolved configuration
stacker config examplePrint a full commented reference
stacker config setup cloudGuided cloud deployment setup
stacker ai ask "question"Ask the AI about your stack
stacker proxy addAdd a reverse-proxy domain entry
stacker proxy detectAuto-detect existing reverse-proxy containers
stacker ssh-key generateGenerate a new SSH key pair for a server (Vault-backed)
stacker ssh-key showDisplay the public SSH key for a server
stacker ssh-key uploadUpload an existing SSH key pair for a server
stacker service addAdd a service from the template catalog to stacker.yml
stacker service listList available service templates (20+ built-in)
stacker agent healthCheck Status Panel agent connectivity and health
stacker agent statusDisplay agent snapshot — containers, versions, uptime
stacker agent logs <app>Retrieve container logs from the remote agent
stacker agent restart <app>Restart a container via the agent
stacker agent deploy-appDeploy or update an app container on the target server
stacker agent remove-appRemove an app container (with optional volume/image cleanup)
stacker agent configure-proxyConfigure Nginx Proxy Manager via the agent
stacker agent historyShow recent command execution history
stacker agent execExecute a raw agent command with JSON parameters
stacker loginAuthenticate with the TryDirect platform
stacker updateCheck for updates and self-update

Deploy targets

stacker deploy --target local# docker compose up (default)
stacker deploy --target cloud # Terraform + Ansible → cloud provider
stacker deploy --target server # deploy to existing server via SSH
stacker deploy --dry-run # preview generated files without executing

Key features

  • Auto-detection — identifies Node, Python, Rust, Go, PHP, static sites from project files
  • Dockerfile generation — produces optimised multi-stage Dockerfiles per app type
  • Docker Compose generation — wires app + services + proxy + monitoring
  • AI-assisted config — scans project, calls LLM to generate tailored stacker.yml
  • AI troubleshooting — on deploy failure, suggests fixes via AI or deterministic fallback hints
  • Service catalog — 20+ built-in service templates (Postgres, Redis, WordPress, etc.) — add with stacker service add
  • AI service addition — ask stacker ai ask --write "add wordpress" and the AI uses the template catalog
  • Agent controlstacker agent subcommand to manage remote Status Panel agents (health, logs, restart, deploy, proxy) with --json output
  • SSH key management — generate, view, and upload server SSH keys (Vault-backed)
  • Reverse proxy — auto-detects Nginx / Nginx Proxy Manager, configures domains + SSL
  • Cloud deployment — Hetzner, DigitalOcean, AWS, Linode

2. Stacker Server

The backend platform powering the Stack Builder UI, REST API, deployment orchestration, and MCP server for AI agents.

Setup

cp configuration.yaml.dist configuration.yaml # edit database, vault, AMQP settings
cp access_control.conf.dist access_control.conf
export DATABASE_URL=postgres://postgres:postgres@localhost:5432/stacker
sqlx migrate run
cargo run --bin server # http://127.0.0.1:8000

Key API endpoints

EndpointDescription
POST /projectCreate a project from a stack definition
POST /{id}/deploy/{cloud_id}Deploy to a cloud provider
GET /project/{id}/appsList apps in a project
PUT /project/{id}/apps/{code}/envUpdate app environment variables
PUT /project/{id}/apps/{code}/portsUpdate port mappings
PUT /project/{id}/apps/{code}/domainUpdate domain / SSL settings
POST /api/v1/commandsEnqueue a command for the Status Panel agent

MCP Server

Stacker exposes 52+ Model Context Protocol tools over WebSocket, enabling AI agents (Claude, GPT, etc.) to manage infrastructure programmatically:

  • Project & deployment management
  • Container operations (start, stop, restart, exec)
  • Log analysis & error summaries
  • Vault config read/write
  • Proxy configuration
  • App environment & port management
  • Server resource monitoring
  • Docker Compose generation & preview
  • Agent control (deploy app, remove app, configure proxy, get status)
  • Firewall management (iptables rules via Status Panel or SSH)

Key integrations

  • HashiCorp Vault — secrets and config storage, synced to deployments
  • RabbitMQ — deployment status updates, event-driven orchestration
  • TryDirect User Service — OAuth, marketplace templates, payment validation
  • Marketplace — publish and deploy community stacks

3. Status Panel Agent

A lightweight agent deployed alongside your application on the target server. It runs as a Docker container and communicates with Stacker Server using a pull-only architecture — the agent polls for commands, Stacker never dials out.

How it works

1. UI/API creates a command → POST /api/v1/commands
2. Command stored in DB queue → commands + command_queue tables
3. Agent polls for work → GET /api/v1/agent/commands/wait/{hash}
4. Agent executes locally → Docker API on the host
5. Agent reports result → POST /api/v1/agent/commands/report

All agent requests are HMAC-signed (X-Agent-Signature header) using a token stored in Vault.

Supported commands

CommandDescription
healthCheck container health status (single or all)
logsFetch container logs (stdout/stderr, with limits)
restartRestart a container
deploy_appDeploy or update an app container
remove_appRemove an app container
configure_proxyCreate/update/delete reverse-proxy entries
configure_firewallConfigure iptables firewall rules (add/remove/list/flush)
stacker.execExecute a command inside a running container (with security blocklist)
stacker.server_resourcesCollect server resource metrics (CPU, memory, disk, network)
apply_configPull config from Vault and apply to a running container

Agent registration

# Agent self-registers on first boot (no auth required)
POST /api/v1/agent/register
{ "deployment_hash": "abc123", "capabilities": [...], "system_info": {...} }
→ { "agent_id": "...", "agent_token": "..." }

Token rotation

cargo run --bin console -- Agent rotate-token \
--deployment-hash <hash> \
--new-token <NEW_TOKEN>

Database migrations

sqlx migrate run # apply
sqlx migrate revert # rollback

Testing

cargo test# all tests (467+)
cargo test user_service_client # User Service connector
cargo test marketplace_webhook # Marketplace webhook flows
cargo test deployment_validator # Deployment validation

Documentation


License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Latest commit

History

1,294 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

DiscordVersionLicense



Build, deploy, and manage containerised applications with a single config file.

Stacker is a platform for turning any project into a deployable Docker stack. Add a stacker.yml to your repo, and Stacker generates Dockerfiles, docker-compose definitions, reverse-proxy configs, and deploys locally or to cloud providers — optionally with AI assistance.

Three components

ComponentWhat it doesBinary
Stacker CLIDeveloper tool — init, deploy, monitor from the terminalstacker-cli
Stacker ServerREST API + Stack Builder UI + deployment orchestration + MCP Serverserver
Status Panel AgentDeployed alongside your app on the target server — executes commands, streams logs, reports health(separate repo)
┌──────────────┐ ┌──────────────────┐ ┌─────────────────────┐
│ Stacker CLI │────────►│ Stacker Server │────────►│ Status Panel Agent │
│ │ REST │ │ queue │ (on target server) │
│ stacker.yml │ API │ Stack Builder UI│ pull │ │
│ init/deploy │ │ 48+ MCP tools │◄────────│ health / logs / │
│ status/logs │ │ Vault · AMQP │ HMAC │ restart / exec / │
└──────────────┘ └──────────────────┘ │ deploy_app / proxy │
│ └─────────────────────┘
▼
Terraform + Ansible ──► Cloud
(Hetzner, DO, AWS, Linode)

Quick Start

Install the CLI

curl -fsSL https://raw.githubusercontent.com/trydirect/stacker/main/install.sh | bash

Create & deploy a project

cd my-project
stacker init # auto-detects project type, generates stacker.yml
stacker deploy # builds and runs locally via docker compose
stacker status # check running containers

AI-powered init (optional)

Stacker can scan your project files and use an LLM to generate a tailored stacker.yml:

# Local AI with Ollama (free, private, default)
stacker init --with-ai
# OpenAI
stacker init --with-ai --ai-provider openai --ai-api-key sk-...
# Anthropic (key from env)export ANTHROPIC_API_KEY=sk-ant-...
stacker init --with-ai --ai-provider anthropic

If the AI provider is unreachable, Stacker falls back to template-based generation automatically.


stacker.yml example

name: my-appapp:
type: nodepath: ./srcports:
- "8080:3000"environment:
NODE_ENV: productionservices:
- name: postgresimage: postgres:16environment:
POSTGRES_DB: myappPOSTGRES_PASSWORD: ${DB_PASSWORD}proxy:
type: nginxauto_detect: truedomains:
- domain: app.example.comssl: autoupstream: app:3000deploy:
target: local # or: cloud, serverai:
enabled: trueprovider: ollamamodel: llama3monitoring:
status_panel: truehealthcheck:
endpoint: /healthinterval: 30s

Full schema reference: docs/STACKER_YML_REFERENCE.md


1. Stacker CLI

The end-user tool. No server required for local deploys.

Commands

CommandDescription
stacker initDetect project type, generate stacker.yml + .stacker/ artifacts
stacker deployBuild & deploy the stack (local, cloud, or server)
stacker statusShow running containers and health
stacker logsView container logs (--follow, --service, --tail)
stacker list deploymentsList deployments on the Stacker server
stacker destroyTear down the deployed stack
stacker config validateValidate stacker.yml syntax
stacker config showShow resolved configuration
stacker config examplePrint a full commented reference
stacker config setup cloudGuided cloud deployment setup
stacker ai ask "question"Ask the AI about your stack
stacker proxy addAdd a reverse-proxy domain entry
stacker proxy detectAuto-detect existing reverse-proxy containers
stacker ssh-key generateGenerate a new SSH key pair for a server (Vault-backed)
stacker ssh-key showDisplay the public SSH key for a server
stacker ssh-key uploadUpload an existing SSH key pair for a server
stacker service addAdd a service from the template catalog to stacker.yml
stacker service listList available service templates (20+ built-in)
stacker agent healthCheck Status Panel agent connectivity and health
stacker agent statusDisplay agent snapshot — containers, versions, uptime
stacker agent logs <app>Retrieve container logs from the remote agent
stacker agent restart <app>Restart a container via the agent
stacker agent deploy-appDeploy or update an app container on the target server
stacker agent remove-appRemove an app container (with optional volume/image cleanup)
stacker agent configure-proxyConfigure Nginx Proxy Manager via the agent
stacker agent historyShow recent command execution history
stacker agent execExecute a raw agent command with JSON parameters
stacker loginAuthenticate with the TryDirect platform
stacker updateCheck for updates and self-update

Deploy targets

stacker deploy --target local# docker compose up (default)
stacker deploy --target cloud # Terraform + Ansible → cloud provider
stacker deploy --target server # deploy to existing server via SSH
stacker deploy --dry-run # preview generated files without executing

Key features

  • Auto-detection — identifies Node, Python, Rust, Go, PHP, static sites from project files
  • Dockerfile generation — produces optimised multi-stage Dockerfiles per app type
  • Docker Compose generation — wires app + services + proxy + monitoring
  • AI-assisted config — scans project, calls LLM to generate tailored stacker.yml
  • AI troubleshooting — on deploy failure, suggests fixes via AI or deterministic fallback hints
  • Service catalog — 20+ built-in service templates (Postgres, Redis, WordPress, etc.) — add with stacker service add
  • AI service addition — ask stacker ai ask --write "add wordpress" and the AI uses the template catalog
  • Agent controlstacker agent subcommand to manage remote Status Panel agents (health, logs, restart, deploy, proxy) with --json output
  • SSH key management — generate, view, and upload server SSH keys (Vault-backed)
  • Reverse proxy — auto-detects Nginx / Nginx Proxy Manager, configures domains + SSL
  • Cloud deployment — Hetzner, DigitalOcean, AWS, Linode

2. Stacker Server

The backend platform powering the Stack Builder UI, REST API, deployment orchestration, and MCP server for AI agents.

Setup

cp configuration.yaml.dist configuration.yaml # edit database, vault, AMQP settings
cp access_control.conf.dist access_control.conf
export DATABASE_URL=postgres://postgres:postgres@localhost:5432/stacker
sqlx migrate run
cargo run --bin server # http://127.0.0.1:8000

Key API endpoints

EndpointDescription
POST /projectCreate a project from a stack definition
POST /{id}/deploy/{cloud_id}Deploy to a cloud provider
GET /project/{id}/appsList apps in a project
PUT /project/{id}/apps/{code}/envUpdate app environment variables
PUT /project/{id}/apps/{code}/portsUpdate port mappings
PUT /project/{id}/apps/{code}/domainUpdate domain / SSL settings
POST /api/v1/commandsEnqueue a command for the Status Panel agent

MCP Server

Stacker exposes 52+ Model Context Protocol tools over WebSocket, enabling AI agents (Claude, GPT, etc.) to manage infrastructure programmatically:

  • Project & deployment management
  • Container operations (start, stop, restart, exec)
  • Log analysis & error summaries
  • Vault config read/write
  • Proxy configuration
  • App environment & port management
  • Server resource monitoring
  • Docker Compose generation & preview
  • Agent control (deploy app, remove app, configure proxy, get status)
  • Firewall management (iptables rules via Status Panel or SSH)

Key integrations

  • HashiCorp Vault — secrets and config storage, synced to deployments
  • RabbitMQ — deployment status updates, event-driven orchestration
  • TryDirect User Service — OAuth, marketplace templates, payment validation
  • Marketplace — publish and deploy community stacks

3. Status Panel Agent

A lightweight agent deployed alongside your application on the target server. It runs as a Docker container and communicates with Stacker Server using a pull-only architecture — the agent polls for commands, Stacker never dials out.

How it works

1. UI/API creates a command → POST /api/v1/commands
2. Command stored in DB queue → commands + command_queue tables
3. Agent polls for work → GET /api/v1/agent/commands/wait/{hash}
4. Agent executes locally → Docker API on the host
5. Agent reports result → POST /api/v1/agent/commands/report

All agent requests are HMAC-signed (X-Agent-Signature header) using a token stored in Vault.

Supported commands

CommandDescription
healthCheck container health status (single or all)
logsFetch container logs (stdout/stderr, with limits)
restartRestart a container
deploy_appDeploy or update an app container
remove_appRemove an app container
configure_proxyCreate/update/delete reverse-proxy entries
configure_firewallConfigure iptables firewall rules (add/remove/list/flush)
stacker.execExecute a command inside a running container (with security blocklist)
stacker.server_resourcesCollect server resource metrics (CPU, memory, disk, network)
apply_configPull config from Vault and apply to a running container

Agent registration

# Agent self-registers on first boot (no auth required)
POST /api/v1/agent/register
{ "deployment_hash": "abc123", "capabilities": [...], "system_info": {...} }
→ { "agent_id": "...", "agent_token": "..." }

Token rotation

cargo run --bin console -- Agent rotate-token \
--deployment-hash <hash> \
--new-token <NEW_TOKEN>

Database migrations

sqlx migrate run # apply
sqlx migrate revert # rollback

Testing

cargo test# all tests (467+)
cargo test user_service_client # User Service connector
cargo test marketplace_webhook # Marketplace webhook flows
cargo test deployment_validator # Deployment validation

Documentation


License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages