Gitlab
Configure Gitlab repositories for deployments. This includes setting up access tokens, repository names, and branches.
Dokploy offer a way to connect your Gitlab Repository to your Dokploy panel, you can use Groups Names or personal accounts.
Go to Git and select Gitlab as the source, then you can use the following options:
- Application ID: Select the application ID that you want to connect to Dokploy.
- Personal Secret: Select the secret that you want to connect to Dokploy.
- Group Name(Optional): Select the group name that you want to connect to Dokploy(Ideal for Gitlab Groups).
Follow the steps to connect your Gitlab account to Dokploy.
- Go to
https://gitlab.com/-/profile/applicationsand click onAdd New Application. - Set Application Name: eg.
Dokploy-Gitlab-App. choose any name that you want. - Redirect URI: Copy the
Redirect URIfrom Dokploy. eg.https://dokploy.com/api/providers/gitlab/callback. - Select Permissions:
api,read_user,read_repository. - Click on
Save Application. - Copy the
Application IDandSecretfrom Gitlab and paste it in DokployGitlabModal section. - (Optional) If you want to use Groups, go to
https://gitlab.com/dashboard/groupsenter the group name you want to connect, and look at the URL in the address bar, it will be something like thishttps://gitlab.com/dokploy-panel/frontendyou can use Nested Groups and SubGroups and copy thedokploy-panel/frontendfrom Gitlab and paste it in DokployGitlabModal section. - Click on
Continue. - Go Back to Dokploy and click on
Installbutton. - Click on
Authorize. - You will be redirected to the
Gitsection of Dokploy. - Now you can use the repositories from your Gitlab Account in
ApplicationsorDocker Composeservices.
Dokploy doesn't support Gitlab Automatic deployments on each push you make to your repository.
Setup Automatic Deployments
You can configure automatic deployments in Dokploy for the Following Services:
- Applications
- Docker Compose
The steps are the same for both services.
- Go to either
ApplicationsorDocker Composeand go toDeploymentsTab. - Copy the
Webhook URL. - Go to your Gitlab Account and select the repository.
- In the left menu, select
Settingsand thenWebhooks. - Click on
Add Webhook. - Set the
URLto the one you copied in the previous step. - In the Trigger section, select
Push Events. - Click on
Add Webhook. - Click on
Save. - Now you have automatic deployments enabled for the selected repository.
Clarification on Automatic Deployments
By default, Dokploy will automatically deploy your application on the Branch you have selected.
eg. Let's suppose you have a application in this way:
Repository: my-app
Branch: feature
If you try to make a push on another branch eg. main, Dokploy will not automatically deploy your application, because
your application have selected feature as the Branch.
In the case you want to have multiple applications in the same repository, eg. (development, staging, production), you can create 3 Applications in Dokploy
and select the branch in each of them.
This is very usefull if you want to have multiple environments for the same application.