GitLab is a powerful open-source DevOps platform used for managing Git repositories, CI/CD pipelines, code reviews, and more. It’s widely adopted by developers and teams to streamline software development and deployment. In this guide, you’ll learn how to install GitLab on an Ubuntu server.
Before you begin, make sure you have the following:
First, ensure your system packages are up-to-date:
GitLab requires some dependencies to be installed beforehand:
You should also install Postfix for sending email notifications (or choose another MTA):
During installation, select “Internet Site” when prompted and enter your server’s hostname.
Use the official GitLab installation script to add the repository:
Note: This adds the GitLab Enterprise Edition repository. If you want the Community Edition, replace gitlab-ee with gitlab-ce in the next step.
Now install GitLab by specifying your domain or server IP:
If you don’t have a domain name, use your server’s IP instead (e.g., http://123.123.123.123
).
Once installed, run the following command to reconfigure GitLab:
This will initialize GitLab, configure services, and start all necessary components.
Open your browser and navigate to:
On the first login, you’ll be prompted to set the admin password. The default admin username is:
For production use, you should secure GitLab using HTTPS. You can either:
Manually install an SSL certificate
Use Let’s Encrypt during setup
To enable Let’s Encrypt, edit the GitLab configuration:
Uncomment and update these lines:
Then reconfigure:
You can manage GitLab services using the following commands:
You’ve successfully installed GitLab on your Ubuntu server! From here, you can start creating projects, setting up CI/CD pipelines, adding users, and more. For advanced configuration and usage, visit the official GitLab documentation.
Need a version tailored for a specific use case (self-hosted, cloud, enterprise, etc.)? I can help with that too!