GitLab Integration ​
Public Repositories ​
You can use public repositories without any additional setup.
Select the
Public repositoryoption in the Coolify when you create a new resource.Add your repository URL to the input field, for example:
https://gitlab.com/andrasbacsai/coolify-examplesCaution
You can only use the https URL.
That's it! Coolify will automatically pull the latest version of your repository and deploy it.
Private Repositories ​
Private repositories require a few more steps to setup.
- Add a private key (aka
Deploy Keys) to Coolify and to your GitLab repository in theSettings/Repository/Deploy Keysmenu.
Caution
- You can generate a new key pair with the following command:
ssh-keygen -t rsa -b 4096 -C "deploy_key"- Or you can also use Coolify to generate a new key for you in the
Keys & Tokensmenu.
- Create a new resource and select the
Private Repository (with deploy key) - Add your repository URL to the input field, for example:
[email protected]:andrasbacsai/coolify-examples.git
Caution
You need to use the SSH URL, so the one that starts with git@.
- That's it! Coolify will automatically pull the latest version of your repository and deploy it.
Public Container Registry ​
You can use public container registry without any additional setup.
- Select the
Docker Imageoption in the Coolify when you create a new resource. - Add your public container registry URL and also the tag to the input field, for example:
registry.gitlab.com/username/repository:latest. - Press the
Deploybutton. - That's it! Coolify will automatically pull the latest version of your container registry and deploy it.
Private Container Registry ​
Private container registry require a few more steps to setup.
- Add a
Deploy Tokenin your GitLab repository in theSettings/Repository/Deploy Tokenwith scoperead_registry. This step will generate credentialsusernameandtoken - login docker with that credentials in your coolify server
echo "token-xxx" | docker login registry.privategitlab.com -u gitlab+deploy-token-xxx --password-stdin- Select the
Docker Imageoption in the Coolify when you create a new resource. - Add your private container registry URL and also the tag to the input field, for example:
registry.privategitlab.com/username/repository:latest. - Press the
Deploybutton. - That's it! Coolify will automatically pull the latest version of your container registry and deploy it.
Automatic commit deployments with webhooks (Optional) ​
You can add a custom webhook URL to your GitLab repository to trigger a new deployment when you push to your repository.
Caution
This can be set on either public or private repositories.
In your resource, there is a Webhooks menu. In the Manual Git Webhooks section, you can find the URL what you need to set in your GitLab repository.
- Set a secret key in the
GitLab Webhook Secretinput field. - Go to your repository in GitLab and open the
Settings/Webhooksmenu. - Add the URL from Coolify to the
URLinput field and the secret token. - Select the
Push eventsoption. - That's it! Now when you push to your repository, GitLab will send a webhook request to Coolify and it will trigger a new deployment.
Merge request deployments with webhooks (Optional) ​
You can add a custom webhook URL to your GitLab repository to trigger a new deployment when you create a new merge request.
Caution
This can be set on either public or private repositories.
The process is the same as the previous one, but you need to select the Merge request events option in the Settings / Webhooks menu.
