| name | coolify-deployment |
| description | Deep knowledge about deploying applications to Coolify (self-hosted PaaS). |
| type | transform |
| tier | library |
| domain | deploy |
| trigger | when deploying to Coolify |
Context
Deploying {{project_name}} ({{project_type}}) to Coolify.
You will follow a strict 6-phase Deployment Lifecycle Contract.
Instructions
Execute the following phases in order:
Phase 1: Authentication
- Coolify is often triggered via a webhook or Git integration rather than a CLI tool.
- If deploying manually, ensure you have the
COOLIFY_API_TOKEN (or webhook secret) available in your environment variables.
- If using an SSH-based CLI script for Coolify, ensure your SSH keys (
~/.ssh/id_rsa) are configured and authorized on the Coolify server.
Phase 2: Build
- Prepare the artifacts for deployment. Coolify typically relies on Nixpacks, buildpacks, or a
Dockerfile in the repository root.
- If using a
Dockerfile, ensure it successfully builds locally (docker build .) to verify correctness before pushing.
- If generating static assets before pushing, run your framework's build command (e.g.,
npm run build).
Phase 3: Install / Provisioning
- Ensure the target Coolify application exists on the Coolify dashboard.
- Ensure the webhook URL provided by Coolify is correctly configured in your Git repository (GitHub/GitLab/Bitbucket) or available for the agent to trigger.
- Ensure any necessary databases (PostgreSQL, Redis, etc.) are provisioned and linked to your application in Coolify.
Phase 4: Deploy
- Ship the artifact to Coolify.
- If integrated with Git, a
git push origin main or a pull request merge will automatically trigger a deployment.
- If deploying manually via a webhook, trigger it using
curl -X POST <COOLIFY_WEBHOOK_URL>.
- If Coolify provides an API endpoint for deployment, use it with the required authentication token.
Phase 5: Checking
- Verify the deployment was successful.
- Check the Coolify dashboard for the deployment status. If available, retrieve the deployment logs via the Coolify API.
- Retrieve the public URL assigned by Coolify and use
curl -sSf <URL> to ensure the application returns a 200 OK status code.
Phase 6: Update / Rollback
- If Phase 5 fails, immediately initiate a rollback.
- Coolify supports reverting to previous deployments via its dashboard or by pushing a revert commit to the connected Git branch.
- Note the failure in the progress log.
Validation