Open a web browser and point it to (where SERVER is the IP address or domain of your server). You should see a long string of random characters that will serve as your root password login. Sudo cat /srv/gitlab/config/initial_root_password When the deployment completes, you’ll need to access the automatically generated root password with the command: The deployment of the container will take some time (anywhere between 10-30 minutes, depending on the speed of your network connection), so either sit back and watch the output fly by or take care of some other task. Change the Default SSH Portīecause GitLab uses the default SSH port, you must change the default SSH server port. Log out and log back in for the changes to take effect. Sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose -y For this, we’ll add the official Docker GPG key with:Ĭurl -fsSL | sudo gpg -dearmor -o /usr/share/keyrings/docker-archive-keyring.gpgĮcho "deb $(lsb_release -cs) stable" | sudo tee /etc/apt//docker.list > /dev/nullįinally, install Docker Community Edition with:
Next, we need to install the Community Edition of Docker. Sudo apt install ca-certificates curl openssh-server apt-transport-https gnupg lsb-release -y
Log in to your Ubuntu instance and install the required software with the command: The first thing we’ll do is install the required dependencies. Either way, you’re ready to make some magic. The instance of Ubuntu can be hosted on your LAN, or even in your cloud-hosted account (although hosting it via a third-party kind of defeats the purpose of a self-hosted repository). To accomplish this task, you’ll need a running instance of Ubuntu Server 22.04 and a user with sudo privileges. And so, without further ado, let’s get to work.
It’s not overly complicated, but there are a number of steps required. With the help of both Ubuntu Server 22.04 and Docker, you can do just that.
Have you ever wanted to host your own GitLab repositories to ensure your code never falls into the wrong hands? Although hosting your repositories on a third-party cloud host has plenty of advantages (such as availability and reliability), there’s something to be said about having total control over your repositories so that no one can access it without your approval.