SSD Grow

Guide to Installing GitLab on Your VPS for Hosting

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.

If you don’t want to pay for GitHub or Bitbucket paid features, or if you want to maintain full control over your codebase, then a self-hosted GitLab installation is a great option.

Today, we’ll walk you through how to install GitLab on your VPS Hosting running Ubuntu, Debian or CentOs.

Requirements for GitLab installation

  • A VPS running Ubuntu 16.04/18.04, Debian 8/9/10, or CentOS 7
  • A regular (non-root) account with sudo privileges.
  • A VPS that meets the hardware requirements.
  • Step 1: Installing Dependencies

    To get ready to install GitLab on your VPS Hosting, you need to install some dependencies.
    Luckily, they’re available in default repositories:
    Ubuntu 16.04/18.04, Debian 8/9/10

    $ sudo apt install curl openssh-server ca-certificates postfix

    Centos 7

    $ 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

    Step 2: Installing GitLab on VPS

    First, you need to add the GitLab repository, and then install the package.
    Ubuntu 16.04/18.04, Debian 8/9/10

    $ curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

    $ sudo apt install gitlab-ce

    CentOS 7

    $ 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

    Step 3: Run and configure GitLab

    You’ve now installed GitLab on your VPS Hosting, 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

    Step 4: Log into GitLab for the first 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 Hosting!

    Conclusion

    In conclusion, installing GitLab on your VPS Hosting offers a robust solution for managing your software development projects. By leveraging GitLab’s comprehensive set of features, including version control, issue tracking, CI/CD pipelines, and more, you can streamline your development workflow and collaborate effectively with your team. Additionally, hosting GitLab on your VPS gives you full control over your data and infrastructure, ensuring security and privacy. With proper installation and configuration, GitLab on your VPS Hosting can greatly enhance your development process, enabling you to deliver high-quality software efficiently.

    Related Articles