Prerequisites
- A running Coolify instance (v4.0+)
- Coolify API token
- At least one server registered in Coolify
- Generated stack with
docker-compose.ymland.env
Setup Coolify
If you don’t have Coolify installed, follow the official installation guide:http://your-server-ip:8000.
Generate an API token
Deploy via CLI
Interactive mode
Run the deploy command in your generated stack directory:- Platform: Select
Coolify - Instance URL: Your Coolify instance (e.g.,
https://coolify.example.com) - API key: Paste the token from above
- Test the connection
- Discover the first available server
- Create a Coolify project
- Create a compose service
- Push environment variables
- Trigger the deployment
Non-interactive mode
For CI/CD pipelines, provide all flags:--json for machine-readable output:
Deploy via Web UI
Generate stack in Web UI
Open the better-openclaw web UI at
http://localhost:3654.Select services, proxy, and configuration options.Configure deployment
Select Coolify as the provider.Enter:
- Instance URL:
https://coolify.example.com - API Key: Your Coolify token
Deployment workflow
The deployer follows these steps:Discover server
Queries Coolify for available servers and selects the first one.API endpoint:
GET /api/v1/serversThe deployer uses the first server’s UUID for deployment.Create project
Creates a new Coolify project with the stack name.API endpoint:
POST /api/v1/projectsCreate compose service
Creates a Docker Compose service inside the project’s production environment.API endpoint:
POST /api/v1/servicesUploads the generated docker-compose.yml via the docker_compose_raw field.Set environment variables
Pushes all variables from
.env to the compose service.API endpoint: PATCH /api/v1/services/{uuid}/envsEach variable is sent with:is_preview: false— Production environmentis_build_time: false— Runtime variableis_literal: true— Use raw value
Monitoring deployment
CLI output
The CLI displays step-by-step progress:Coolify dashboard
Open the dashboard URL to:- View deployment logs
- Monitor service health
- Manage environment variables
- Configure domains and SSL
Managing deployed stacks
Update environment variables
Alternatively, edit variables directly in the Coolify dashboard:
- Navigate to Project > Service
- Click Environment Variables
- Edit values and click Save
- Click Redeploy
View logs
Stream logs for a service:- Navigate to Project > Service
- Click Logs tab
- Select a container from the dropdown
- Logs will stream in real-time
Redeploy stack
Trigger a redeployment:- Navigate to Project > Service
- Click Deploy button
- Confirm the deployment
Configure domains
Add a custom domain:- Navigate to Project > Service
- Click Domains tab
- Click Add Domain
- Enter your domain (e.g.,
app.example.com) - Enable Generate SSL Certificate for automatic Let’s Encrypt SSL
- Click Save
CI/CD integration
GitHub Actions
GitLab CI
Troubleshooting
Connection failed
Error:Coolify API 401: Unauthorized
Solution: Verify your API token:
- Regenerate token in Coolify dashboard
- Ensure token has
*permission - Check for typos in the token
No servers found
Error:No servers found in Coolify instance
Solution: Register a server in Coolify:
- Navigate to Servers > Add Server
- Follow the setup wizard to connect your server
- Wait for the server to become “Validated”
Project creation failed
Error:Coolify API 409: Conflict
Solution: The project name is already in use. Either:
- Delete the existing project in Coolify
- Regenerate the stack with a different name
Deployment timeout
Error: Services taking too long to start Solution:- Check service logs in Coolify dashboard
- Verify image availability (check Docker Hub/registry)
- Increase health check intervals in
docker-compose.yml
Environment variables not applied
Error: Services fail due to missing env vars Solution:- Ensure
.envfile exists in the stack directory - Check that all required variables are set
- Manually verify variables in Coolify dashboard under Environment Variables
- Redeploy to push updated variables
API reference
The Coolify deployer uses these API endpoints:| Endpoint | Method | Purpose |
|---|---|---|
/api/v1/version | GET | Test connection |
/api/v1/servers | GET | Discover servers |
/api/v1/projects | POST | Create project |
/api/v1/projects/{uuid} | GET | Get project details |
/api/v1/services | POST | Create compose service |
/api/v1/services/{uuid}/envs | PATCH | Update environment variables |
/api/v1/deploy | GET | Trigger deployment |
Authorization: Bearer <token>
See the Coolify API docs for full reference.
Environment variable schema
When pushing variables via the bulk env API, each variable is sent with this structure:is_preview: false— Production environmentis_build_time: false— Runtime variable (not baked into image)is_literal: true— Use raw value (no variable interpolation)
Next steps
- Dokploy deployment for an alternative PaaS
- Docker deployment for local development
- VPS deployment for manual cloud setup