This documentation provides a step-by-step guide on how to build and start the GitLab Community Edition (CE) project. Note that this guide assumes familiarity with GitLab and its general structure.
Prerequisites
Before proceeding with the build process, ensure you have the following prerequisites installed on your system:
- Git: Used for cloning repositories.
- Ruby: The version specified in the
.ruby-version
file. - Node.js and Yarn: Used for managing JavaScript dependencies.
- PostgreSQL: Required database for the application.
- Redis: In-memory data structure store used as a database cache.
- Docker: Optional, for running GitLab in a containerized environment.
Cloning the Repository
Start by cloning the GitLab CE repository:
git clone https://gitlab.com/gitlab-org/gitlab-ce.git
cd gitlab-ce
Installing Dependencies
Ruby Dependencies
Install the Ruby dependencies using Bundler:
bundle install --deployment --without development test
JavaScript Dependencies
Install JavaScript dependencies using Yarn:
yarn install --check-files
Database Setup
Configure and set up the PostgreSQL database. Create the database and run the necessary migrations:
# Setup the database
bundle exec rake db:create db:migrate
If you need to load sample data, run:
bundle exec rake db:seed
Configuration
Before starting the application, you may need to configure various settings in the config
directory. Ensure that the required files are properly configured, particularly:
gitlab.yml
: General GitLab configuration file.database.yml
: Database configuration file.
Example: database.yml
development:
adapter: postgresql
encoding: unicode
database: gitlab_development
username: gitlab
password: <%= ENV['GITLAB_DATABASE_PASSWORD'] %>
host: localhost
Starting the Application
You can start the application using the following command:
bundle exec rails s
This starts the Rails server, and the application will be available at http://localhost:3000
.
Alternative: Using Docker
If you prefer to run the application within Docker containers, you can use the provided docker-compose.yml
file to set up the environment.
docker-compose up
This command will start all necessary services defined in the docker-compose
file.
Accessing the Application
Once the application is running, access it in your web browser at:
http://localhost:3000
You can log in using the default admin credentials:
- Username:
root
- Password:
5iveL!fe
Conclusion
Following these steps will allow you to successfully build and start the GitLab CE project. For further customization and configuration, refer to the project’s documentation.
Source: gitlab-org/gitlab-ce