If you’re hosting GitLab on a cloud provider, you can optionally use a managed service for PostgreSQL. For example, AWS offers a managed Relational Database Service (RDS) that runs PostgreSQL.
Alternatively, you may opt to manage your own PostgreSQL instance or cluster separate from the Omnibus GitLab package.
If you use a cloud-managed service, or provide your own PostgreSQL instance:
- Set up PostgreSQL according to the database requirements document.
- Set up a
gitlabusername with a password of your choice. The
gitlabuser needs privileges to create the
- If you are using a cloud-managed service, you may need to grant additional
roles to your
Configure the GitLab application servers with the appropriate connection details for your external PostgreSQL service in your
# Disable the bundled Omnibus provided PostgreSQL postgresql['enable'] = false # PostgreSQL connection details gitlab_rails['db_adapter'] = 'postgresql' gitlab_rails['db_encoding'] = 'unicode' gitlab_rails['db_host'] = '10.1.0.5' # IP/hostname of database server gitlab_rails['db_password'] = 'DB password'
For more information on GitLab HA setups, refer to configuring GitLab for HA.
Reconfigure for the changes to take effect:
sudo gitlab-ctl reconfigure