Coolify API Skill
Comprehensive management of Coolify deployments, applications, databases, services, and infrastructure via the Coolify API.
When to Use This Skill
Use this skill when the user needs to:
- - Deploy applications to Coolify
- Manage application lifecycle (start, stop, restart)
- View application logs
- Create and manage databases (PostgreSQL, MySQL, MongoDB, Redis, etc.)
- Deploy Docker Compose services
- Manage servers and infrastructure
- Configure environment variables
- Trigger and monitor deployments
- Manage GitHub App integrations
- Configure SSH private keys
Prerequisites
- 1. Coolify API Token — Generate from Coolify dashboard:
- Navigate to
Keys & Tokens →
API tokens
- Create token with appropriate permissions (
read,
write,
deploy)
- Set
COOLIFY_TOKEN environment variable
- 2. bash, curl, jq — Required for running bash scripts
- 3. API Access — Coolify Cloud (
app.coolify.io) or self-hosted instance
Quick Start
Basic Commands
CODEBLOCK0
Applications
List Applications
CODEBLOCK1
Output:
CODEBLOCK2
Get Application Details
CODEBLOCK3
Application Lifecycle
CODEBLOCK4
View Logs
CODEBLOCK5
Environment Variables
CODEBLOCK6
Create Applications
CODEBLOCK7
Databases
List Databases
CODEBLOCK8
Get Database Details
CODEBLOCK9
Database Lifecycle
CODEBLOCK10
Create Databases
CODEBLOCK11
Backups
CODEBLOCK12
Services (Docker Compose)
List Services
CODEBLOCK13
Get Service Details
CODEBLOCK14
Service Lifecycle
CODEBLOCK15
Create Service
CODEBLOCK16
Environment Variables
CODEBLOCK17
Deployments
Deploy Application
CODEBLOCK18
List Deployments
CODEBLOCK19
Get Deployment Details
CODEBLOCK20
Cancel Deployment
CODEBLOCK21
Servers
List Servers
CODEBLOCK22
Get Server Details
CODEBLOCK23
Create Server
CODEBLOCK24
Update Server
CODEBLOCK25
Validate Server
CODEBLOCK26
Get Server Resources
CODEBLOCK27
Delete Server
CODEBLOCK28
Projects
List Projects
CODEBLOCK29
Get Project Details
CODEBLOCK30
Create Project
CODEBLOCK31
Update Project
CODEBLOCK32
Delete Project
CODEBLOCK33
Environments
CODEBLOCK34
Teams
List Teams
CODEBLOCK35
Get Current Team
CODEBLOCK36
Get Team Members
CODEBLOCK37
Get Team by ID
CODEBLOCK38
Security (Private Keys)
List Private Keys
CODEBLOCK39
Get Private Key
CODEBLOCK40
Create Private Key
CODEBLOCK41
Update Private Key
CODEBLOCK42
Delete Private Key
CODEBLOCK43
GitHub Apps
List GitHub Apps
CODEBLOCK44
Get GitHub App
CODEBLOCK45
Create GitHub App
CODEBLOCK46
Update GitHub App
CODEBLOCK47
Delete GitHub App
CODEBLOCK48
List Repositories
CODEBLOCK49
List Branches
CODEBLOCK50
Common Use Cases
Deploy a New Application
- 1. List available servers:
CODEBLOCK51
- 2. Create application:
CODEBLOCK52
- 3. Configure environment variables:
CODEBLOCK53
- 4. Deploy:
CODEBLOCK54
Set Up Database with Backups
- 1. Create database:
CODEBLOCK55
- 2. Configure daily backups:
CODEBLOCK56
- 3. Trigger manual backup:
CODEBLOCK57
Monitor Application Health
- 1. Check application status:
CODEBLOCK58
- 2. View recent logs:
CODEBLOCK59
- 3. List recent deployments:
{baseDir}/scripts/coolify deployments list-for-app --uuid abc-123
Troubleshooting
"API token not configured"
Cause: COOLIFY_TOKEN environment variable not set.
Solution:
CODEBLOCK61
Or configure in OpenClaw config at ~/.openclaw/openclaw.json:
CODEBLOCK62
"Rate limit exceeded"
Cause: Too many API requests in a short time.
Solution: The client automatically retries with exponential backoff. Wait for the retry or reduce request frequency.
"Application not found"
Cause: Invalid or non-existent UUID.
Solution:
CODEBLOCK63
"connect ECONNREFUSED"
Cause: Cannot connect to Coolify API.
Solution for self-hosted:
CODEBLOCK64
Solution for cloud: Verify internet connection and that app.coolify.io is accessible.
"Deployment failed"
Cause: Build or deployment error.
Solution:
- 1. Check deployment logs:
CODEBLOCK65
- 2. Check application logs:
CODEBLOCK66
- 3. Verify environment variables are correct:
CODEBLOCK67
Node.js Not Found
Cause: Node.js not installed or not in PATH.
Solution:
# macOS (via Homebrew)
brew install node
# Verify installation
node --version
Output Format
All commands return structured JSON:
Success Response
CODEBLOCK69
Error Response
CODEBLOCK70
Configuration
Environment Variables
| Variable | Required | Default | Description |
|---|
| INLINECODE8 | Yes | — | API token from Coolify dashboard |
| INLINECODE9 |
No |
https://app.coolify.io/api/v1 | API base URL (for self-hosted) |
Self-Hosted Coolify
For self-hosted instances, set the API URL:
CODEBLOCK71
Additional Resources
- - Coolify Documentation: https://coolify.io/docs/
- API Reference: See INLINECODE11
- GitHub: https://github.com/coollabsio/coolify
- Discord: https://coollabs.io/discord
Edge Cases and Best Practices
UUID vs Name
Most commands require UUIDs, not names. Always use list commands first to find UUIDs:
CODEBLOCK72
Force Deployments
Use --force flag carefully as it rebuilds from scratch:
CODEBLOCK73
Environment Variable Updates
After updating environment variables, restart the application:
CODEBLOCK74
Backup Frequency
Use cron expressions for backup schedules:
| Expression | Description |
|---|
| INLINECODE14 | Daily at 2 AM |
| INLINECODE15 |
Every 6 hours |
|
0 0 * * 0 | Weekly on Sunday at midnight |
|
0 0 1 * * | Monthly on 1st at midnight |
Summary
This skill provides complete access to Coolify's API across:
- - Applications — Deployment, lifecycle, logs, environment variables
- Databases — 8 database types, backups, lifecycle management
- Services — Docker Compose orchestration
- Deployments — Trigger, monitor, cancel
- Servers — Infrastructure management and validation
- Projects — Organization and environment management
- Teams — Access control and collaboration
- Security — SSH key management
- GitHub Apps — Repository integration
All operations return structured JSON for easy agent consumption.
Coolify API 技能
通过 Coolify API 全面管理 Coolify 部署、应用程序、数据库、服务和基础设施。
何时使用此技能
当用户需要以下操作时使用此技能:
- - 将应用程序部署到 Coolify
- 管理应用程序生命周期(启动、停止、重启)
- 查看应用程序日志
- 创建和管理数据库(PostgreSQL、MySQL、MongoDB、Redis 等)
- 部署 Docker Compose 服务
- 管理服务器和基础设施
- 配置环境变量
- 触发和监控部署
- 管理 GitHub App 集成
- 配置 SSH 私钥
前提条件
- 1. Coolify API 令牌 — 从 Coolify 仪表盘生成:
- 导航至
密钥与令牌 →
API 令牌
- 创建具有适当权限(read、write、deploy)的令牌
- 设置 COOLIFY_TOKEN 环境变量
- 2. bash、curl、jq — 运行 bash 脚本所需
- 3. API 访问 — Coolify Cloud(app.coolify.io)或自托管实例
快速入门
基本命令
bash
列出所有应用程序
{baseDir}/scripts/coolify applications list
获取应用程序详情
{baseDir}/scripts/coolify applications get --uuid abc-123
部署应用程序
{baseDir}/scripts/coolify deploy --uuid abc-123 --force
查看应用程序日志
{baseDir}/scripts/coolify applications logs --uuid abc-123
重启应用程序
{baseDir}/scripts/coolify applications restart --uuid abc-123
应用程序
列出应用程序
bash
{baseDir}/scripts/coolify applications list
输出:
json
{
success: true,
data: [
{
uuid: abc-123,
name: my-app,
status: running,
fqdn: https://app.example.com
}
],
count: 1
}
获取应用程序详情
bash
{baseDir}/scripts/coolify applications get --uuid abc-123
应用程序生命周期
bash
启动
{baseDir}/scripts/coolify applications start --uuid abc-123
停止
{baseDir}/scripts/coolify applications stop --uuid abc-123
重启
{baseDir}/scripts/coolify applications restart --uuid abc-123
查看日志
bash
{baseDir}/scripts/coolify applications logs --uuid abc-123
环境变量
bash
列出环境变量
{baseDir}/scripts/coolify applications envs list --uuid abc-123
创建环境变量
{baseDir}/scripts/coolify applications envs create \
--uuid abc-123 \
--key DATABASE_URL \
--value postgres://user:pass@host:5432/db \
--is-runtime true \
--is-buildtime false
更新环境变量
{baseDir}/scripts/coolify applications envs update \
--uuid abc-123 \
--env-uuid env-456 \
--value new-value
批量更新环境变量
{baseDir}/scripts/coolify applications envs bulk-update \
--uuid abc-123 \
--json {DATABASE
URL:postgres://...,APIKEY:...}
删除环境变量
{baseDir}/scripts/coolify applications envs delete \
--uuid abc-123 \
--env-uuid env-456
创建应用程序
bash
公共 Git 仓库
{baseDir}/scripts/coolify applications create-public \
--project-uuid proj-123 \
--server-uuid server-456 \
--git-repository https://github.com/user/repo \
--git-branch main \
--name My App
私有 GitHub App
{baseDir}/scripts/coolify applications create-private-github-app \
--project-uuid proj-123 \
--server-uuid server-456 \
--github-app-uuid gh-789 \
--git-repository user/repo \
--git-branch main
Dockerfile
{baseDir}/scripts/coolify applications create-dockerfile \
--project-uuid proj-123 \
--server-uuid server-456 \
--dockerfile-location ./Dockerfile \
--name My Docker App
Docker 镜像
{baseDir}/scripts/coolify applications create-dockerimage \
--project-uuid proj-123 \
--server-uuid server-456 \
--docker-image nginx:latest \
--name Nginx
Docker Compose
{baseDir}/scripts/coolify applications create-dockercompose \
--project-uuid proj-123 \
--server-uuid server-456 \
--docker-compose-location ./docker-compose.yml
数据库
列出数据库
bash
{baseDir}/scripts/coolify databases list
获取数据库详情
bash
{baseDir}/scripts/coolify databases get --uuid db-123
数据库生命周期
bash
启动
{baseDir}/scripts/coolify databases start --uuid db-123
停止
{baseDir}/scripts/coolify databases stop --uuid db-123
重启
{baseDir}/scripts/coolify databases restart --uuid db-123
删除
{baseDir}/scripts/coolify databases delete --uuid db-123
创建数据库
bash
PostgreSQL
{baseDir}/scripts/coolify databases create-postgresql \
--project-uuid proj-123 \
--server-uuid server-456 \
--name my-postgres \
--postgres-user admin \
--postgres-password secret \
--postgres-db myapp
MySQL
{baseDir}/scripts/coolify databases create-mysql \
--project-uuid proj-123 \
--server-uuid server-456 \
--name my-mysql
MariaDB
{baseDir}/scripts/coolify databases create-mariadb \
--project-uuid proj-123 \
--server-uuid server-456 \
--name my-mariadb
MongoDB
{baseDir}/scripts/coolify databases create-mongodb \
--project-uuid proj-123 \
--server-uuid server-456 \
--name my-mongo
Redis
{baseDir}/scripts/coolify databases create-redis \
--project-uuid proj-123 \
--server-uuid server-456 \
--name my-redis
KeyDB
{baseDir}/scripts/coolify databases create-keydb \
--project-uuid proj-123 \
--server-uuid server-456 \
--name my-keydb
ClickHouse
{baseDir}/scripts/coolify databases create-clickhouse \
--project-uuid proj-123 \
--server-uuid server-456 \
--name my-clickhouse
Dragonfly
{baseDir}/scripts/coolify databases create-dragonfly \
--project-uuid proj-123 \
--server-uuid server-456 \
--name my-dragonfly
备份
bash
列出备份配置
{baseDir}/scripts/coolify databases backups list --uuid db-123
创建备份配置
{baseDir}/scripts/coolify databases backups create \
--uuid db-123 \
--frequency 0 2
* \
--enabled true
获取备份详情
{baseDir}/scripts/coolify databases backups get \
--uuid db-123 \
--backup-uuid backup-456
更新备份
{baseDir}/scripts/coolify databases backups update \
--uuid db-123 \
--backup-uuid backup-456 \
--frequency 0 3
*
触发手动备份
{baseDir}/scripts/coolify databases backups trigger \
--uuid db-123 \
--backup-uuid backup-456
列出备份执行记录
{baseDir}/scripts/coolify databases backups executions \
--uuid db-123 \
--backup-uuid backup-456
删除备份配置
{baseDir}/scripts/coolify databases backups delete \
--uuid db-123 \
--backup-uuid backup-456
服务(Docker Compose)
列出服务
bash
{baseDir}/scripts/coolify services list
获取服务详情
bash
{baseDir}/scripts/coolify services get --uuid service-123
服务生命周期
bash
启动
{baseDir}/scripts/coolify services start --uuid service-123
停止
{base