Prerequisites
- A running Dokploy instance (v0.5.0+)
- Dokploy API token
- Generated stack with
docker-compose.ymland.env
Setup Dokploy
If you don’t have Dokploy installed, follow the official installation guide:http://your-server-ip:3000.
Generate an API token
Deploy via CLI
Interactive mode
Run the deploy command in your generated stack directory:- Platform: Select
Dokploy - Instance URL: Your Dokploy instance (e.g.,
https://dokploy.example.com) - API key: Paste the token from above
- Test the connection
- Create a Dokploy project
- Create a compose stack
- 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 Dokploy as the provider.Enter:
- Instance URL:
https://dokploy.example.com - API Key: Your Dokploy token
Deployment workflow
The deployer follows these steps:Create project
Creates a new Dokploy project with the stack name.API endpoint:
POST /api/project.createCreate compose stack
Creates a Docker Compose stack inside the project’s default environment.API endpoint:
POST /api/compose.createUploads the generated docker-compose.yml.Set environment variables
Pushes all variables from
.env to the compose stack.API endpoint: POST /api/compose.updateMonitoring deployment
CLI output
The CLI displays step-by-step progress:Dokploy 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 Dokploy dashboard:
- Navigate to Project > Compose
- Click Environment Variables
- Edit values and click Save
- Click Redeploy
Scale services
Scale services in the Dokploy dashboard:- Navigate to Project > Compose
- Click on a service
- Adjust Replicas
- Click Save and Redeploy
View logs
Stream logs for a service:- Navigate to Project > Compose
- Click on a service
- Click Logs tab
- Enable Follow for live streaming
Redeploy stack
Trigger a redeployment:- Navigate to Project > Compose
- Click Deploy
- Optionally add a deployment title/description
CI/CD integration
GitHub Actions
GitLab CI
Troubleshooting
Connection failed
Error:Dokploy API 401: Unauthorized
Solution: Verify your API token:
- Regenerate token in Dokploy dashboard
- Ensure token has full permissions
- Check for typos in the token
Project creation failed
Error:Dokploy API 409: Project already exists
Solution: The project name is already in use. Either:
- Delete the existing project in Dokploy
- Regenerate the stack with a different name
Deployment timeout
Error: Services taking too long to start Solution:- Check service logs in Dokploy dashboard
- Verify image availability (check Docker Hub/registry)
- Increase health check intervals in
docker-compose.yml
Missing environment variables
Error: Services fail due to missing env vars Solution:- Ensure
.envfile exists in the stack directory - Check that all required variables are set
- Redeploy to push updated variables
API reference
The Dokploy deployer uses these API endpoints:| Endpoint | Method | Purpose |
|---|---|---|
/api/project.all | GET | Test connection |
/api/project.create | POST | Create project |
/api/project.one | GET | Get project details |
/api/compose.create | POST | Create compose stack |
/api/compose.update | POST | Update environment variables |
/api/compose.deploy | POST | Trigger deployment |
x-api-key: <token>
See the Dokploy API docs for full reference.
Next steps
- Coolify deployment for an alternative PaaS
- Docker deployment for local development
- VPS deployment for manual cloud setup