How to configure gitlab to use existing postgres server

10,956

According to this doc, put this in /etc/gitlab/gitlab.rb :

# Disable the built-in Postgres
postgresql['enable'] = false

# Fill in the values for database.yml
gitlab_rails['db_adapter'] = 'postgresql'
gitlab_rails['db_encoding'] = 'utf8'
gitlab_rails['db_host'] = '127.0.0.1'
gitlab_rails['db_port'] = '5432'
gitlab_rails['db_username'] = 'foo'
gitlab_rails['db_password'] = 'bar'

And run this command to apply this values : sudo gitlab-ctl reconfigure. Also you need to seed your database if you choose an external one. This command will do it with omnibus-gitlab: sudo gitlab-rake gitlab:setup

Share:
10,956
robue-a7119895
Author by

robue-a7119895

a7119895

Updated on June 04, 2022

Comments

  • robue-a7119895
    robue-a7119895 about 2 years

    When installing Gitlab by default Nginx and Postgres .. among other things are installed regardless of whether you have them already or not. So since I have these two already, I am trying to configure gitlab to use them, I have done this for Nginx, Using:

    $ vi /etc/gitlab/gitlab.rb:
    
    # Disable GitLab's nginx completely
    nginx['enable'] = false
    
    # Set external web user which is 'nginx' on CentOS 7
    web_server['external_users'] = ['nginx']
    

    but I need to know how to do the same postgres.

  • Kurt
    Kurt over 7 years
    The remote database user (foo in this example) must be able to create databases and be a superuser during the gitlab-rake command. You may have to install postgresql-contrib on remote server.
  • Hayden
    Hayden about 3 years
    Shouldn't this be port 5432 for Postgres?