This documentation provides a step-by-step guide for expert developers on how to build and start the GitLab project from the gitlab-org/gitlab repository.

Prerequisites

Make sure you have the following prerequisites installed on your machine:

  • Ruby: Version 2.6.5 or above
  • Node.js: Version 12.x or above
  • Yarn: Version 1.22.x
  • PostgreSQL: Version 12 or above
  • Redis: Version 5 or above

You can verify your installation with the following commands:

ruby -v
node -v
yarn -v
psql --version
redis-server --version

Clone the Repository

Begin by cloning the gitlab-org/gitlab repository to your local machine. Use the command below:

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

Install Dependencies

Once you have the repository cloned, install the necessary dependencies for the project. Ruby dependencies can be installed using Bundler, and JavaScript dependencies can be installed using Yarn:

bundle install
yarn install

Make sure Bundler is installed:

gem install bundler

Database Configuration

Next, you need to set up your database. Start by copying the example database configuration file:

cp config/database.yml.sample config/database.yml

Edit the config/database.yml file to configure your database settings. Update the database configuration for your local environment:

development:
  adapter: postgresql
  encoding: unicode
  database: your_database_name
  username: your_username
  password: your_password
  host: localhost
  pool: 5

Create the Database

After configuring the database, create the database and run migrations:

bundle exec rake db:create db:migrate

Seed the Database (Optional)

If you wish to start with some default data, you can seed the database:

bundle exec rake db:seed

Start Redis

Ensure that Redis is running. You may start it with the following command:

redis-server

Start the GitLab Application

Now you are ready to start the GitLab application. Use the following command:

bundle exec rails server

By default, the application will start on http://localhost:3000.

Access the Application

Once the server is running, you can access GitLab in your web browser at:

http://localhost:3000

Log in with the default credentials:

  • Username: root
  • Password: set during the application setup

Conclusion

Following the above steps will allow you to successfully build and start the GitLab project on your local development environment. Make sure to reference the GitLab documentation for additional information regarding contributions and advanced configurations.