- Prerequisites
- Configure GitLab Duo on a self-managed instance
- Run a health check for GitLab Duo
- Turn off GitLab Duo features
- Turn on beta and experimental features
- Troubleshooting
Control GitLab Duo availability
- Settings to turn off AI features introduced in GitLab 16.10.
- Settings to turn off AI features added to the UI in GitLab 16.11.
GitLab Duo features that are generally available are automatically turned on for all users that have access.
Prerequisites
- If you have self-managed GitLab:
- You must allow connectivity.
- Silent Mode must not be turned on.
- You must activate your instance with an activation code.
- GitLab Duo requires GitLab 17.2 and later for the best user experience and results. Earlier versions may continue to work, however the experience may be degraded.
- If you have GitLab Dedicated, you must have GitLab Duo Pro or Enterprise.
- For some generally available features, like Code Suggestions, you must assign seats to the users you want to have access.
GitLab Duo features that are experimental or beta are turned off by default and must be turned on.
Configure GitLab Duo on a self-managed instance
To use GitLab Duo on a self-managed instance, you must ensure both outbound and inbound connectivity exists.
For example, network firewalls can cause lag or delay. Check both your outbound and inbound settings:
Allow outbound connections from the GitLab instance
- Your firewalls and HTTP/S proxy servers must allow outbound connections
to
cloud.gitlab.com
andcustomers.gitlab.com
on port443
both withhttps://
. These hosts are protected by Cloudflare. Update your firewall settings to allow traffic to all IP addresses in the list of IP ranges Cloudflare publishes. - To use an HTTP/S proxy, both
gitLab_workhorse
andgitLab_rails
must have the necessary web proxy environment variables set. - In multi-node GitLab installations, configure the HTTP/S proxy on all Rails and Sidekiq nodes.
Allow inbound connections from clients to the GitLab instance
- GitLab instances must allow inbound connections from Duo clients (IDEs,
Code Editors, and GitLab Web Frontend) on port 443 with
https://
andwss://
. - Both
HTTP2
and the'upgrade'
header must be allowed, because GitLab Duo uses both REST and WebSockets. - Check for restrictions on WebSocket (
wss://
) traffic towss://gitlab.example.com/-/cable
and other.com
domains. Network policy restrictions onwss://
traffic can cause issues with some GitLab Duo Chat services. Consider policy updates to allow these services. - If you use reverse proxies, such as Apache, you might see GitLab Duo Chat connection issues in your logs, like WebSocket connection to …. failures.
To resolve this problem, try editing your Apache proxy settings:
# Enable WebSocket reverse Proxy
# Needs proxy_wstunnel enabled
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/?(.*) "ws://127.0.0.1:8181/$1" [P,L]
Run a health check for GitLab Duo
- Introduced in GitLab 17.3.
- Download health check report added in GitLab 17.5.
Run a health check to test if your instance meets the requirements to use GitLab Duo. When the health check completes, it displays a pass or fail result and the types of issues. If the health check fails any of the tests, users might not be able to use GitLab Duo features in your instance.
This is a beta feature.
Prerequisites:
- You must be an administrator.
To run a health check:
- On the left sidebar, at the bottom, select Admin.
- Select GitLab Duo.
- On the upper-right corner, select Run health check.
- Optional. In GitLab 17.5 and later, after the health check is complete, you can select Download report to save a detailed report of the health check results.
Health check tests
To verify if your instance meets the requirements to use GitLab Duo, the health check performs tests for online and offline environments.
For online environments
Test | Description |
---|---|
Network | Tests whether your instance can connect to customers.gitlab.com and cloud.gitlab.com .If your instance cannot connect to either destination, ensure that your firewall or proxy server settings allow connection. |
Synchronization | Tests whether your subscription: - Has been activated with an activation code and can be synchronized with customers.gitlab.com .- Has correct access credentials. - Has been synchronized recently. If it hasn’t or the access credentials are missing or expired, you can manually synchronize your subscription data. |
System exchange | Tests whether Code Suggestions can be used in your instance. If the system exchange assessment fails, users might not be able to use GitLab Duo features. |
For offline environments
Test | Description |
---|---|
Network | Tests whether: - The environment variable AI_GATEWAY_URL has been set to a valid URL.- Your instance can connect to the URL specified by AI_GATEWAY_URL .If your instance cannot connect to the URL, ensure that your firewall or proxy server settings allow connection. |
License | Tests whether your license has the ability to access Code Suggestions feature. |
System exchange | Tests whether Code Suggestions can be used in your instance. If the system exchange assessment fails, users might not be able to use GitLab Duo features. |
Turn off GitLab Duo features
You can turn off GitLab Duo for a group, project, or instance.
When GitLab Duo is turned off for a group, project, or instance:
- GitLab Duo features that access resources, like code, issues, and vulnerabilities, are not available.
- Code Suggestions is not available.
- Duo Chat is not available.
Turn off for a group
In GitLab 17.4 and later, follow these instructions to turn off GitLab Duo for a group and its subgroups and projects.
Prerequisites:
- You must have the Owner role for the group.
To turn off GitLab Duo for a group:
- On the left sidebar, select Search or go to and find your group.
- Select Settings > General.
- Expand GitLab Duo features.
- Choose an option:
- To turn off GitLab Duo for the group, but let other groups or projects turn it on, select Off by default.
- To turn off GitLab Duo for the group, and to prevent other groups or projects from turning it on, select Never on.
- Select Save changes.
In GitLab 17.3 and earlier, follow these instructions to turn off GitLab Duo for a group and its subgroups and projects.
Turn off for a project
In GitLab 17.4 and later, follow these instructions to turn off GitLab Duo for a project.
Prerequisites:
- You must have the Owner role for the project.
To turn off GitLab Duo for a project:
- On the left sidebar, select Search or go to and find your project.
- Select Settings > General.
- Expand Visibility, project features, permissions.
- Under GitLab Duo, turn the toggle off.
- Select Save changes.
In GitLab 17.3 and earlier, follow these instructions to turn off GitLab Duo for a project.
- Use the GitLab GraphQL API
projectSettingsUpdate
mutation. - Set the
duo_features_enabled
setting tofalse
. (The default istrue
.)
Turn off for an instance
In GitLab 17.4 and later, follow these instructions to turn off GitLab Duo for the instance.
Prerequisites:
- You must be an administrator.
To turn off GitLab Duo for an instance:
- On the left sidebar, at the bottom, select Admin area.
- Select Settings > General.
- Expand GitLab Duo features.
- Choose an option:
- To turn off GitLab Duo for the instance, but let groups and projects turn it on, select Off by default.
- To turn off GitLab Duo for the instance, and to prevent groups or projects from ever turning it on, select Never on.
- Select Save changes.
In GitLab 17.3 and earlier, follow these instructions to turn off GitLab Duo for an instance.
- On the left sidebar, at the bottom, select Admin.
- Select Settings > General
- Expand AI-powered features.
- Clear the Use Duo features checkbox.
- Optional. Select the Enforce for all subgroups checkbox to cascade the setting to all groups in the instance.
Turn on beta and experimental features
GitLab Duo features that are experimental and beta are turned off by default. These features are subject to the Testing Agreement.
On GitLab.com
In GitLab 17.4 and later, follow these instructions to turn on GitLab Duo experimental and beta features for your group on GitLab.com.
Prerequisites:
- You must have the Owner role for the top-level group.
To turn on GitLab Duo experiment and beta features for a top-level group:
- On the left sidebar, select Search or go to and find your group.
- Select Settings > General.
- Expand GitLab Duo features.
- Under GitLab Duo preview features, select Use experiment and beta GitLab Duo features.
- Select Save changes.
In GitLab 17.3 and earlier, follow these instructions to turn on GitLab Duo experimental and beta features for your group on GitLab.com.
- On the left sidebar, select Search or go to and find your group.
- Select Settings > General.
- Expand Permissions and group features.
- Under GitLab Duo experiment and beta features, select the Use experiment and beta GitLab Duo features checkbox.
- Select Save changes.
This setting cascades to all projects that belong to the group.
On self-managed
In GitLab 17.4 and later, follow these instructions to turn on GitLab Duo experiment and beta features for your self-managed instance.
Prerequisites:
- You must be an administrator.
To turn on GitLab Duo experiment and beta features for an instance:
- On the left sidebar, at the bottom, select Admin area.
- Select Settings > General.
- Expand GitLab Duo features.
- Under GitLab Duo preview features, select Use experiment and beta GitLab Duo features.
- Select Save changes.
To enable GitLab Duo beta and experimental features for GitLab versions where GitLab Duo Chat is not yet generally available, see the GitLab Duo Chat documentation.
Troubleshooting
GitLab Duo features do not work on self-managed
In addition to turning on GitLab Duo features, you can also do the following:
-
As administrator, run a health check for GitLab Duo.
In 17.5 and laterIn GitLab 17.5 and later, you can use the UI to run health checks and download a detailed report that helps identify and troubleshoot issues.
In 17.4In GitLab 17.4, you can run the health check Rake task to generate a detailed report that helps identify and troubleshoot issues.
sudo gitlab-rails 'cloud_connector:health_check(root,report.json)'
In 17.3 and earlierIn GitLab 17.3 and earlier, you can download and run the
health_check
script to generate a detailed report that helps identify and troubleshoot issues.-
Download the health check script:
wget https://gitlab.com/gitlab-org/gitlab/-/snippets/3734617/raw/main/health_check.rb
-
Run the script using Rails Runner:
gitlab-rails runner [full_path/to/health_check.rb] --debug --username [username] --output-file [report.txt]
Usage: gitlab-rails runner full_path/to/health_check.rb --debug Enable debug mode --output-file FILE Write a report to FILE --username USERNAME Provide a username to test seat assignments --skip [CHECK] Skip specific check (options: access_data, token, license, host, features, end_to_end)
-
-
Verify that the GitLab instance can reach the required GitLab.com endpoints. You can use command-line tools such as
curl
to verify the connectivity.curl --verbose "https://cloud.gitlab.com" curl --verbose "https://customers.gitlab.com"
If an HTTP/S proxy is configured for the GitLab instance, include the
proxy
parameter in thecurl
command.# https proxy for curl curl --verbose --proxy "http://USERNAME:PASSWORD@example.com:8080" "https://cloud.gitlab.com" curl --verbose --proxy "http://USERNAME:PASSWORD@example.com:8080" "https://customers.gitlab.com"
-
Optional. If you are using a proxy server between the GitLab application and the public internet, disable DNS rebinding protection.
-
Manually synchronize subscription data.
- Verify that the GitLab instance synchronizes your subscription data with GitLab.
GitLab Duo features not available for users
In addition to turning on GitLab Duo features, you can also do the following:
- Verify that subscription seats have been purchased.
- Ensure that seats are assigned to users.
- For IDE users with the GitLab Duo extension:
- Verify that the extension is up-to-date.
- Run extension setting health checks, and test the authentication.