
GitLab is a complete DevOps platform for managing Git repositories, running CI/CD pipelines, tracking issues, and much more. The official and most straightforward way to run a self-managed GitLab instance is via their Docker image.
High system requirements: GitLab is a resource-intensive application. We recommend a server with at least 4 CPU cores and 8 GB of RAM for a stable experience.
Log in to your server via SSH, create a directory for GitLab, and open the Compose file:
Paste the following configuration into the file. You will customize the domain in the next step.
Before starting GitLab, replace all instances of gitlab.example.com in the Compose file with your actual domain (e.g. gitlab.yourdomain.com). Also make sure your domain's DNS A record points to your server's IP address.
You also need to set the $GITLAB_HOME environment variable, which defines where GitLab stores its data. Run the following in the same directory as your Compose file:
To make this persistent across reboots, add the line to your ~/.bashrc or ~/.profile.
Start the GitLab instance with the following command:
Be patient: The first startup requires GitLab to initialize and configure itself. This can take 5 to 15 minutes or longer. The instance will not be accessible until this process is complete. You can monitor the status with docker ps.
GitLab automatically generates a secure password for the initial root administrator account. Once the container is healthy, retrieve it with the following command:
View the password with cat initial_password.txt. Make sure to save it somewhere safe and delete the file afterwards — it is automatically removed after 24 hours.
Open your browser and navigate to the domain you configured (e.g. https://gitlab.yourdomain.com). Log in with the following credentials:
| Field | Value |
|---|---|
| Username | root |
| Password | The password retrieved in Step 4 |
Change your root password immediately after the first login via the user profile settings.
For advanced configuration, CI/CD setup, and administration guides, refer to the official GitLab documentation.