Setting up a GitLab repository in dbt Cloud and creating a project

Setting up a GitLab repository in dbt Cloud and creating a project

2025.08.12

I'm Kawabata.

I'll be setting up a GitLab repository in dbt Cloud and creating a project.
Based on my observation, while there are many articles about GitHub repository setup, I don't see many about GitLab configuration, so I'd like to summarize the setup method in this article.

For GitHub setup, the article below is very helpful, so please check it out.

https://dev.classmethod.jp/articles/dbt-setup-project-with-snowflake-and-github/#toc-dbt-projectgithub

Test Environment and Prerequisites

Test Environment

  • dbt Cloud account
  • GitLab account
    ※I'm using the Enterprise version of dbt Cloud and the Free Plan for GitLab.
    ※For this example, I'll be using Snowflake for [Set Up a Database Connection], but you can choose any warehouse you prefer.

Prerequisites

I'll explain based on the official documentation below.
As a premise, the connection methods differ between dbt Cloud's Developer/Starter plans and Enterprise/Enterprise+ plans. In this article, I'll be implementing the method for Enterprise and Enterprise+ plans.

【Official Documentation】

https://docs.getdbt.com/docs/cloud/git/connect-gitlab#setting-up-a-gitlab-oauth-application

Creating a New Project

Create a new project in dbt. Click on your account name at the bottom left, select Account settings, open Project, and click on +New project in the upper right.

2025-08-12_10h46_07

After navigating to the screen below, enter your desired project name. Once completed, press Continue.
2025-08-12_10h47_49

Next, set up Configure your development environment. For Connection, you can connect using existing settings from the dropdown. If you want to create a new configuration, select +Add new connection to navigate to the new connection setup screen.

Enter your Username and Password under Development credentials, then click Test Connection. When Complete appears as shown below, your connection is established, so click Save.

2025-08-12_14h49_54

Connecting with GitLab

To connect GitLab, a GitLab account administrator needs to perform the following tasks:

  1. Set up a GitLab OAuth application.
  2. Add the GitLab app to dbt.

After the administrator completes the steps above, dbt developers need to:

  1. Authenticate personally from dbt to GitLab.### Setting up GitLab OAuth Application
    Let's configure an OAuth application in GitLab.

  2. Select your icon in the upper left corner of the GitLab screen, then click on settings.

2025-08-12_16h08_21

  1. After navigating to the user settings screen, select Applications.

2025-08-12_16h11_21

  1. Click on Add new application.
    2025-08-12_16h12_13

  2. On the following screen, enter the Name and Redirect URI, check the boxes for "confidential" and "api", then save the application.
    2025-08-12_15h22_20

Regarding the redirect URI,
Replace the YOUR_ACCESS_URL portion of https://YOUR_ACCESS_URL/complete/gitlab with your plan and region. Please refer to the documentation below.
【Access, Region, IP Addresses】
https://docs.getdbt.com/docs/cloud/about-cloud/access-regions-ip-addresses

【Group Application Settings Documentation】

https://docs.gitlab.com/integration/oauth_provider/#group-owned-applications

  1. When you reach the screen below, if everything looks good, click "Next" to complete the application creation.
    You don't need to save the application ID or secret at this point as you can check them later.

2025-08-12_15h24_09

*If you're using BusinessCritical with IP restrictions, please ensure you've added the appropriate GitLab CIDR to your IP restriction rules. Otherwise, GitLab connections may fail.### Connecting GitLab OAuth Application to dbt Cloud
Let's go back to the dbt Cloud screen and set up the connection.

  1. Click on your account name at the bottom left, select Account settings, open Integrations and configure the following GitLab settings.

2025-08-12_16h36_57

Category Content
GitLab instance https://gitlab.com
Application ID Quote from the application we created earlier
Secret Quote from the application we created earlier

※If you have a specially hosted version of GitLab, use the hostname provided by your organization.
Example: https://gitlab.yourgreatcompany.com/

  1. After confirming and saving the above, you'll be redirected to the following screen. If everything looks good, click Authorize dbt Cloud.

2025-08-12_16h37_27

  1. When you see Gitlab integration set up successfully, the setup is complete.
    2025-08-12_16h38_15

Project Repository Settings

Next is setting up the Git repository. Select the Project you created earlier.

  1. Click on your account name at the bottom left, select Account settings, open Project, search for the Project name you created earlier and click on it.

2025-08-12_16h46_27

  1. You'll be redirected to the screen below, select Configure Repository.
    2025-08-12_16h48_51

  2. Select GitLab from the screen below. The GitLab connection is displayed, so click on it.

2025-08-12_16h50_24

Now the linking to the Project is complete.## Check GitLab
Click "Initialize your project" from Studio IDE to start your project.
We will commit the default file structure that was added as shown below.

2025-08-12_16h56_07

Click "Create a merge request".

2025-08-12_16h59_35

You will be redirected to GitLab's merge request screen as shown below. Enter the required information and merge.
2025-08-12_17h01_24

The main branch now looks like this, and we can confirm that everything is properly linked.
2025-08-12_17h04_31

In Conclusion

What did you think?
GitHub and GitLab each have their own functional characteristics, so I feel it's necessary to choose between them based on your use case.
I hope this serves as a helpful reference when connecting to GitLab!

Share this article

FacebookHatena blogX

Related articles

dbt CloudでGitLabリポジトリの設定を行いプロジェクトを作ってみる | DevelopersIO