Book Image

GitLab Cookbook

By : Jeroen van Baarsen
Book Image

GitLab Cookbook

By: Jeroen van Baarsen

Overview of this book

Table of Contents (16 chapters)
GitLab Cookbook
About the Author
About the Reviewers

Set up the database for source installation

GitLab can be installed using PostgreSQL or MySQL. In this recipe, I will use PostgreSQL as it is the recommended database engine.

How to do it…

The following steps are applicable for Debian-based systems; they are also possible with RedHat. You can take a look at for the installation instructions.

  1. Install PostgreSQL 9.1:

    sudo apt-get install -y postgresql-9.1 postgresql-client libpq-dev
  2. Create the PostgreSQL user for GitLab:

    sudo –u  postgresql psql –d template1 –c "CREATE USER git CREATEDB"
  3. Create the database for GitLab and grant all privileges on the database:

    sudo –u postgresql psql –d template1 –c "CREATE DATABASE gitlabhq_production OWNER git"