| name | coolify-operator |
| description | Master Coolify operator for self-hosted deployment platform. Use when the user mentions 'coolify', 'deploy on coolify', 'list/restart/redeploy applications', 'view coolify logs', 'coolify API/CLI', 'manage coolify servers/databases/apps', or 'coolify context'. Automates deployments and management via REST API or official CLI. |
| metadata | {"author":"ft.ia.br","version":"1.1","date":"2026-03-08T00:00:00.000Z","license":"MIT","category":"ci-cd-and-deployment"} |
Coolify Operator
Skill for operating Coolify instances through the REST API or official CLI. Coolify is a self-hosted open-source platform alternative to Heroku/Vercel/Netlify for deploying applications, databases, and services.
When to use this skill
- Connect to Coolify instances (via API or CLI)
- List and manage applications, services, databases, and servers
- Deploy, restart, or stop applications
- View logs and deployment status
- Manage environment variables
- Operate multiple Coolify instances (contexts)
- Troubleshoot Coolify connection issues
Fundamental concepts
Authentication
REST API:
- Base endpoint:
https://YOUR-HOST/api/v1 (always with /api/v1 at the end)
- Authentication:
Authorization: Bearer YOUR_TOKEN
- Token obtained at: Coolify Dashboard → Keys & Tokens → API Tokens
CLI:
- Installs contexts that store HOST + TOKEN
- HOST in context is WITHOUT
/api/v1 (just the base URL)
- CLI adds
/api/v1 automatically
Configuration with pipe in token
⚠️ IMPORTANT: Coolify tokens often contain | (e.g., 3|abc123...). Never use source .env as this breaks in the shell.
Safe .env reading:
COOLIFY_KEY=$(sed -n 's/^COOLIFY_KEY=//p' .env)
COOLIFY=$(sed -n 's/^COOLIFY=//p' .env)
Expected .env format:
COOLIFY_KEY=3|abc123def456...
COOLIFY=http://192.168.1.XXX:8000/api/v1
UUIDs
Coolify uses UUIDs to identify resources:
- Applications:
app-uuid
- Servers:
server-uuid
- Databases:
db-uuid
- Services:
service-uuid
CLI Operations
Initial setup
COOLIFY_KEY=$(sed -n 's/^COOLIFY_KEY=//p' .env)
coolify context add -d -f my-coolify http://192.168.1.XXX:8000 "$COOLIFY_KEY"
coolify context use my-coolify
coolify context verify
coolify context version
Context management
coolify context list
coolify context add prod https://prod.coolify.io "$PROD_TOKEN" --default
coolify context add staging https://staging.coolify.io "$STAGING_TOKEN"
coolify context add dev https://dev.coolify.io "$DEV_TOKEN"
coolify context use staging
coolify --context=prod app list
coolify context set-token prod new-token-here
coolify context delete dev
Application operations
coolify app list
coolify app get <uuid>
coolify app start <uuid>
coolify app stop <uuid>
coolify app restart <uuid>
coolify app logs <uuid>
coolify app env list <uuid>
coolify app env create <uuid> --key API_KEY --value secret123
coolify app env sync <uuid> --file .env
coolify app env sync <uuid> --file .env.production --build-time --preview
Server operations
coolify server list
coolify server get <uuid> --resources
coolify server add myserver 192.168.1.100 <key-uuid> --validate
Team operations
coolify team list
coolify team current
coolify team members list
Global flags
coolify --context <name> ...
coolify --host <fqdn> ...
coolify --token <token> ...
coolify --format json ...
coolify -s ...
coolify --show-sensitive ...
coolify -f ...
coolify --force ...
coolify --debug ...
REST API Operations
Authentication and testing
COOLIFY_KEY=$(sed -n 's/^COOLIFY_KEY=//p' .env)
COOLIFY=$(sed -n 's/^COOLIFY=//p' .env)
curl -sS -i \
-H "Authorization: Bearer $COOLIFY_KEY" \
"$COOLIFY/version"
Applications
curl -sS \
-H "Authorization: Bearer $COOLIFY_KEY" \
"$COOLIFY/applications"
curl -sS \
-H "Authorization: Bearer $COOLIFY_KEY" \
"$COOLIFY/applications/{uuid}"
curl -sS \
-H "Authorization: Bearer $COOLIFY_KEY" \
"$COOLIFY/applications/{uuid}/start"
curl -sS \
-H "Authorization: Bearer $COOLIFY_KEY" \
"$COOLIFY/applications/{uuid}/stop"
curl -sS \
-H "Authorization: Bearer $COOLIFY_KEY" \
"$COOLIFY/applications/{uuid}/restart"
Deployments
curl -sS \
-H "Authorization: Bearer $COOLIFY_KEY" \
"$COOLIFY/deployments"
curl -sS \
-H "Authorization: Bearer $COOLIFY_KEY" \
"$COOLIFY/deployments/applications/{uuid}?skip=0&take=10"
Servers
curl -sS \
-H "Authorization: Bearer $COOLIFY_KEY" \
"$COOLIFY/servers"
curl -sS \
-H "Authorization: Bearer $COOLIFY_KEY" \
"$COOLIFY/servers/{uuid}"
Databases
curl -sS \
-H "Authorization: Bearer $COOLIFY_KEY" \
"$COOLIFY/databases"
curl -sS \
-H "Authorization: Bearer $COOLIFY_KEY" \
"$COOLIFY/databases/{uuid}/start"
curl -sS \
-H "Authorization: Bearer $COOLIFY_KEY" \
"$COOLIFY/databases/{uuid}/stop"
curl -sS \
-H "Authorization: Bearer $COOLIFY_KEY" \
"$COOLIFY/databases/{uuid}/restart"
Services
curl -sS \
-H "Authorization: Bearer $COOLIFY_KEY" \
"$COOLIFY/services/{uuid}/restart"
Troubleshooting
Error: 403 "You are not allowed to access the API"
Cause: Invalid token or no permission for the instance.
Solution:
- Ask the user to verify in the instance at <INSTANCE_URL>/settings/advanced whether the API is enabled and the client IP is allowed
- Regenerate token at: Dashboard → Keys & Tokens → API Tokens
- Update
.env or CLI context
- Verify that the correct instance is being used
Error: 401 "Unauthenticated"
Cause: Incorrect authentication header or token not sent.
Solution:
Authorization: Bearer YOUR_TOKEN
coolify context verify
Error: 404 on context verify
Cause: CLI context URL is incorrect (probably with /api/v1 in the wrong place).
Solution:
coolify context add my-coolify http://192.168.1.XXX:8000 "$TOKEN"
COOLIFY=http://192.168.1.XXX:8000/api/v1
Cloudflare Tunnel is not the cause
If the API already returns valid JSON from Coolify (even if it's an auth error), the Cloudflare tunnel is working. The problem is authentication, not connectivity.
Token with pipe (|) breaks shell
source .env
COOLIFY_KEY=$(sed -n 's/^COOLIFY_KEY=//p' .env)
Common workflows
Full deploy of a new application
coolify context add prod https://coolify.your-domain.com "$TOKEN" --default
coolify context verify
coolify server list
coolify app list
coolify app start <uuid>
coolify app logs <uuid>
Redeploy with force rebuild
coolify app restart <uuid>
curl -sS \
-H "Authorization: Bearer $COOLIFY_KEY" \
"$COOLIFY/applications/{uuid}/start?force=true"
Update environment variables
coolify app env sync <uuid> --file .env.production
coolify app env create <uuid> --key API_URL --value https://api.example.com
coolify app env create <uuid> --key API_KEY --value secret123
coolify app restart <uuid>
Multi-environment monitoring
coolify --context=prod app list
coolify --context=prod app logs <prod-app-uuid>
coolify --context=staging app list
coolify --context=staging app logs <staging-app-uuid>
coolify --context=dev app list
coolify --context=dev server list
Important resources
API response structure
Application:
{
"id": 123,
"uuid": "app-uuid-123",
"name": "my-app",
"fqdn": "app.example.com",
"status": "running",
"git_repository": "https://github.com/user/repo",
"git_branch": "main",
"git_commit_sha": "abc123",
"build_pack": "nixpacks",
"ports_exposes": "3000",
"health_check_enabled": true,
"environment_id": 1,
"destination_id": 1
}
Server:
{
"id": 1,
"uuid": "server-uuid-123",
"name": "main-server",
"ip": "192.168.1.100",
"user": "root",
"port": 22,
"settings": {
"is_reachable": true,
"is_usable": true,
"concurrent_builds": 1
}
}
Deployment:
{
"id": 456,
"uuid": "deployment-uuid-456",
"status": "finished",
"deployment_uuid": "dep-123",
"application_id": 123
}
Usage tips
- Always verify UUIDs: Use
coolify app list or API to confirm UUIDs before operations
- Contexts for multi-environment: Configure one context for each environment (dev/staging/prod)
- Real-time logs: Use
coolify app logs <uuid> during deploys
- Force rebuild when needed:
?force=true on start ensures complete rebuild
- Token security: Never commit tokens. Use
.env with .gitignore
- JSON format for scripts: Use
--format json in CLI for parsing with jq
Quality Checklist
Before executing any operation, verify:
References