How to create GitLab repositories on your own server
Gitlab is one of the most popular providers of GIT repositories in the world, but did you know that you can install GitLab software on your own server and start hosting your projects completely privately without any cost?
To install GitLab on your own server you just have to follow the following steps:
1. Access your server by SSH
Remember that you will need root privileges to be able to install GitLab successfully.
2. Install the necessary dependencies
Remember to update the list of packages before proceeding with the installation of the packages.
apt-get update
Then:
apt-get install curl openssh-server ca-certificates
3. Install the Postfix mail server, if you wish to send emails from the server itself
Execute the following command:
apt-get install postfix
4. Download the GitLab repository package and add it to your list of repositories
In this step, you will download an executable script directly from the GitLab page:
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
5. Proceed to the installation of GitLab
In this case, it will be necessary to specify the URL to which GitLab should respond. Replace the text between braces with your own URL:
EXTERNAL_URL="http://{gitlab.tudominio.com}" apt-get install gitlab-ee
6. Configure GitLab from the web interface and finish with the configuration
It is done! Now you just have to visit the URL you have specified (remember to modify your DNS records) and proceed with the GitLab installer.
With these simple steps, you can enjoy your own repository service completely private on your own server.