❤️ AZDIGI has officially updated to a new blog system. However, some posts may have incorrect or mismatched images. Please click the Report article button at the bottom of the post so AZDIGI can update as quickly as possible. Thank you!

To truly automate your deployment process, you need to connect Coolify with a Git provider. Push code → auto deploy. Open PR → get preview URL. This guide shows how to integrate GitHub, GitLab and Bitbucket with Coolify.

📖 Previous post: Part 7, Docker Compose

I. Git Connection Methods

MethodAuto-deployPreview PRsPrivate reposComplexity
Public RepositoryPolling onlySimplest
Deploy Key✅ WebhookMedium
GitHub App✅ WebhookSetup once

💡 GitHub App is the best choice: full support for auto-deploy, preview deployments, private repos, and granular permission management.

Sources page on Coolify
Sources — connect GitHub App, GitLab or Bitbucket for auto-deploy.

II. GitHub App Integration (Recommended)

Step 1: Create GitHub App

  1. In Coolify, go to Sources → click “+ Add”
Adding new Git source on Coolify
Add GitHub App — create connection for auto-deploy on code push.
  1. Choose “GitHub App”
  2. Coolify redirects to GitHub → create new GitHub App
  3. Name your app (e.g. “Coolify Deploy”)
  4. Choose repositories to allow (all or specific selection)
  5. Click “Create GitHub App”

Step 2: Install GitHub App

After creation, GitHub asks to install app to your account/organization. Choose repos you want Coolify to access → Install.

Step 3: Deploy from Private Repo

  1. New Resource → “Private Repository (with GitHub App)”
  2. Select the GitHub App you just created
  3. Coolify displays repo list → choose repo to deploy
  4. Select branch → Configure → Deploy

ℹ️ GitHub App automatically configures webhooks, every push to selected branch will trigger redeploy. No additional configuration needed.

III. Deploy Key Method

Deploy Key uses SSH key to access private repos. Simpler than GitHub App but no preview deployments.

  1. New Resource → “Private Repository (with Deploy Key)”
  2. Coolify generates SSH key and displays public key
  3. Copy public key → go to GitHub repo → Settings → Deploy Keys → Add
  4. Return to Coolify → paste repo URL (SSH format: git@github.com:user/repo.git)
  5. Check repository → select branch → Deploy

IV. GitLab & Bitbucket

GitLab

  1. Go to Sources → Add → GitLab
  2. Create Personal Access Token on GitLab (Settings → Access Tokens)
  3. Required scope: api, read_repository
  4. Paste token into Coolify → Save
  5. Deploy: choose GitLab source → select repo → deploy

Bitbucket

  1. Sources → Add → Bitbucket
  2. Create App Password on Bitbucket (Settings → App Passwords)
  3. Permissions: Repository read, Webhooks read/write
  4. Paste credentials into Coolify
Webhooks configuration on Coolify
Webhooks — trigger deploy from external sources or GitHub Actions.

V. GitHub Actions + Coolify API

If you already have CI/CD pipeline on GitHub Actions, you can trigger Coolify deploy via API:

# .github/workflows/deploy.yml
name: Deploy to Coolify
on:
  push:
    branches: [main]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Trigger Coolify Deploy
        run: |
          curl -X POST \
            "${{ secrets.COOLIFY_URL }}/api/v1/deploy" \
            -H "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}" \
            -H "Content-Type: application/json" \
            -d '{"uuid": "${{ secrets.COOLIFY_APP_UUID }}"}'

Create API token in Coolify: Security → API Tokens → Create.

VI. Preview Deployments Details

Preview Deployments automatically create URLs for each Pull Request, allowing team review before merge:

  • Requirement: GitHub App integration (Deploy Key not supported)
  • Enable in resource → “Previews” tab
  • URL format: pr-123.app.example.com (needs wildcard DNS)
  • Each PR creates separate container → complete isolation
  • PR closed/merged → container auto-deleted, resources freed

VII. Rollback

Each deployment creates a record. If new version has issues:

  1. Go to resource → “Deployments” tab
  2. Find previous deployment (was working OK)
  3. Click “Redeploy” → Coolify rollback to that version

VIII. Summary

CI/CD on Coolify is not complex, connect GitHub App once, then push code for auto deploy. Preview deployments help team review safely, rollback with 1 click when issues occur. Next post: Database on Coolify, creation, management and backup.

Share:
This article has been reviewed by AZDIGI Team

About the author

Trần Thắng

Trần Thắng

Expert at AZDIGI with years of experience in web hosting and system administration.

10+ years serving 80,000+ customers

Start your web project with AZDIGI