Install GitLab On Your VPS To Host A Repository (Tutorial)
Why install GitLab on your VPS?
GitLab is an open source application that offers a graphical user interface (GUI) to help manage Git repositories. It includes lots of features, such as issue tracking and easy pull requests and merges.
Today, we’ll walk you through how to install GitLab on your VPS running Ubuntu, Debian or CentOs.
Get THE BEST DEALS IN CLOUD HOSTING from Los Angeles!Grab a huge 32GB RAM & 320GB of SSD storage for just $109/year!
- A VPS running Ubuntu 16.04/18.04, Debian 8/9/10, or CentOS 7
- A regular (non-root) account with sudo privileges. See our SSH keys tutorial for more information.
- A VPS that meets the hardware requirements. Any 8GB or larger VPS from SSD Nodes should to the trick.
To get ready to install GitLab on your VPS, you need to install some dependencies.
Luckily, they’re available in default repositories:
$ sudo apt install curl openssh-server ca-certificates postfix
$ sudo yum install curl policycoreutils openssh-server openssh-clients $ sudo systemctl enable sshd $ sudo systemctl start sshd $ sudo yum install postfix $ sudo systemctl enable postfix $ sudo systemctl start postfix $ sudo firewall-cmd --permanent --add-service=http $ sudo systemctl reload firewalld
First, you need to add the GitLab repository, and then install the package.
Note: We recommend that you check all scripts you’re executing as the sudo user before you execute them. You can find GitLab’s install script here.
$ curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash $ sudo apt install gitlab-ce
$ curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash $ sudo yum install gitlab-ce
This operation might take a bit to complete.
When it’s done, you’ll see the following output:
*. *. *** *** ***** ***** .****** ******* ******** ******** ,,,,,,,,,***********,,,,,,,,, ,,,,,,,,,,,*********,,,,,,,,,,, .,,,,,,,,,,,*******,,,,,,,,,,,, ,,,,,,,,,*****,,,,,,,,,. ,,,,,,,****,,,,,, .,,,***,,,, ,*,. _______ __ __ __ / ____(_) /_/ / ____ _/ /_ / / __/ / __/ / / __ `/ __ / /_/ / / /_/ /___/ /_/ / /_/ / ____/_/__/_____/__,_/_.___/ gitlab: Thank you for installing GitLab! gitlab: To configure and start GitLab, RUN THE FOLLOWING COMMAND: sudo gitlab-ctl reconfigure
You’ve now installed GitLab on your VPS, so let’s fire it up and make sure it’s running smoothly.
See that command above? Give it a whirl.
$ sudo gitlab-ctl reconfigure
You’ll see quite a bit of output as the script operates.
If you need to make any changes to the external URL, for example, or any of the other configuration options, you can edit the
gitlab.rb script and then re-run the configuration.
$ sudo nano /etc/gitlab/gitlab.rb $ sudo gitlab-ctl reconfigure
IMPORTANT: If you followed our previous tutorial on installing a LEMP stack, you will need to configure GitLab to work with your existing nginx installation. GitLab has detailed instructions on how to configure the connection in their documentation.
What’s the BEST DEAL in cloud hosting?
Develop at hyperspeed with a Performance VPS from SSD Nodes. We DOUBLED the amount of blazing-fast NVMe storage on our most popular plan and beefed up the CPU offering on these plans. There’s nothing else like it on the market, at least not at these prices.
Score a 16GB Performance VPS with 160GB of NVMe storage for just $99/year for a limited time!
Once you’ve made any changes to GitLab’s configuration and it’s up and running without errors, you can direct your web browser to the default external URL, or the one you chose.
If you see the following page, you’ve successfully installed GitLab!
Provide a password for the administrator account when prompted.
Then enter the password you choose, and then you’ll be directed to a login screen.
The administrator username is
root by default. Enter that plus the password you just created, and you’ll be ready to start managing your Git repositories directly on your own VPS!