GitLab Cookbook
上QQ阅读APP看书,第一时间看更新

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 gitlab.com 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"