This document provides a step-by-step guide for expert developers on how to build and start the GitLab Community Edition (gitlab-org/gitlab-ce) project.

Prerequisites

Before starting the build process, ensure you have the following installed on your machine:

  • Ruby (version 2.7 or newer)
  • Node.js (version 14 or newer)
  • Yarn (version 1.22 or newer)
  • PostgreSQL (version 12 or newer)
  • Redis (version 5 or newer)
  • Git

Clone the Repository

First, clone the GitLab CE repository from GitLab:

git clone https://gitlab.com/gitlab-org/gitlab-ce.git
cd gitlab-ce

Install Dependencies

After cloning the repository, install the required Ruby gems:

bundle install --without development test

Then, install the JavaScript dependencies using Yarn:

yarn install

Configure Database

Create a database configuration file:

cp config/database.yml.example config/database.yml

Edit config/database.yml to set up your database connection information. For example:

development:
  adapter: postgresql
  encoding: unicode
  database: gitlab_development
  pool: 5
  username: gitlab
  password: password
  host: localhost
  port: 5432

Setup Database

Create the required databases and run migrations:

bundle exec rake db:create db:migrate

Seed the database with initial data:

bundle exec rake db:seed

Precompile Assets

Precompile the assets to optimize them for production:

RAILS_ENV=production bundle exec rake assets:precompile

Start the Application

You can start the application in development mode using the following command:

bundle exec rails s -b 0.0.0.0 -p 3000

This command binds the server to all IP addresses on port 3000. The application will be accessible via http://localhost:3000.

For production mode, set the environment variable and start the server:

RAILS_ENV=production bundle exec rails s

Access the Application

Visit the application at the specified address in your web browser:

http://localhost:3000

Conclusion

You have now built and started the GitLab CE project. From here, you can proceed to explore its features or contribute to its development.

Source: GitLab Documentation