2020-06-03 16:04:07 +00:00
---
2022-09-21 18:19:11 +00:00
stage: Systems
2020-06-03 16:04:07 +00:00
group: Distribution
2023-12-05 03:40:46 +00:00
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
2020-06-03 16:04:07 +00:00
---
2024-01-24 07:29:14 +00:00
# Changing `gitlab.yml` and `application.yml` settings
DETAILS:
**Tier:** Free, Premium, Ultimate
**Offering:** Self-managed
2014-11-03 15:32:24 +00:00
2020-12-15 23:53:24 +00:00
Some GitLab features can be customized through
2019-08-13 16:42:56 +00:00
[`gitlab.yml` ](https://gitlab.com/gitlab-org/gitlab-foss/blob/master/config/gitlab.yml.example ). If you want to change a `gitlab.yml` setting
2023-08-02 06:46:52 +00:00
for a Linux package installation, you need to do so with `/etc/gitlab/gitlab.rb` . The
2015-04-07 23:04:19 +00:00
translation works as follows. For a complete list of available options, visit the
2019-09-06 07:23:26 +00:00
[`gitlab.rb.template` ](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template ).
2024-04-23 20:34:58 +00:00
All the options of the template listed in `/etc/gitlab/gitlab.rb` are avilable by default.
2014-11-03 15:32:24 +00:00
2023-03-15 00:23:19 +00:00
In `gitlab.yml` , you find structure like this:
2014-11-03 15:32:24 +00:00
```yaml
production: & base
gitlab:
2015-03-14 01:08:25 +00:00
default_theme: 2
2014-11-03 15:32:24 +00:00
```
In `gitlab.rb` , this translates to:
```ruby
2015-03-14 01:08:25 +00:00
gitlab_rails['gitlab_default_theme'] = 2
2014-11-03 15:32:24 +00:00
```
What happens here is that we forget about `production: &base` , and join
2015-03-14 01:08:25 +00:00
`gitlab:` with `default_theme:` into `gitlab_default_theme` .
2014-11-03 15:32:24 +00:00
Note that not all `gitlab.yml` settings can be changed via `gitlab.rb` yet; see
2019-09-06 07:23:26 +00:00
the [`gitlab.yml.erb` template ](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/gitlab.yml.erb ).
2023-08-02 06:46:52 +00:00
If you think an attribute is missing please create a merge request on the `omnibus-gitlab` repository.
2014-11-03 15:32:24 +00:00
Run `sudo gitlab-ctl reconfigure` for changes in `gitlab.rb` to take effect.
Do not edit the generated file in `/var/opt/gitlab/gitlab-rails/etc/gitlab.yml`
2023-03-15 00:23:19 +00:00
because it is overwritten on the next `gitlab-ctl reconfigure` run.
2014-11-03 15:32:24 +00:00
2016-10-28 13:22:20 +00:00
## Adding a new setting to `gitlab.yml`
2023-02-06 11:02:40 +00:00
First, consider not adding a setting to `gitlab.yml` . See **Settings** under [GitLab-specific concerns ](https://docs.gitlab.com/ee/development/code_review.html#gitlab-specific-concerns ).
2019-10-29 20:39:12 +00:00
Don't forget to update the following 5 files when adding a new setting:
2016-10-28 13:22:20 +00:00
2019-09-06 07:23:26 +00:00
- the [`gitlab.rb.template` ](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template )
file to expose the setting to the end user via `/etc/gitlab/gitlab.rb` .
- the [`default.rb` ](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/attributes/default.rb )
file to provide a sane default for the new setting.
2019-10-29 20:39:12 +00:00
- the [`gitlab.yml.example` ](https://gitlab.com/gitlab-org/gitlab/blob/master/config/gitlab.yml.example )
2019-09-06 07:23:26 +00:00
file to actually use the setting's value from `gitlab.rb` .
2019-10-29 20:39:12 +00:00
- the [`gitlab.yml.erb` ](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/gitlab.yml.erb )
file
2022-10-14 04:06:11 +00:00
- the [`gitlab-rails_spec.rb` ](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/spec/chef/cookbooks/gitlab/recipes/gitlab-rails_spec.rb )
2019-10-29 20:39:12 +00:00
file