How to Quickly Deploy GitLab via Docker
GitLab is a DevOps platform that provides a single location for the entire software development cycle. This developer-centric app includes version control with Git, CI/CD pipelines, issue tracking and security scanning.
According to BuiltWith, there are over 21,000 sites using GitLab, so this tool is nothing to sneeze at.
GitLab can be self-hosted or used via a third-party service. If you’re looking to save money and retain your organization’s privacy, the locally deployed option might be the best route. You might be surprised to find out that deploying an instance of GitLab on your LAN is much easier than you might think.
I’m going to show you how to do just that.
What You’ll Need
To deploy GitLab to your LAN, you’ll need a hosting machine that supports Docker. I’m going to demonstrate the process with Ubuntu Server 24.04, so if your machine uses a different operating system, you’ll need to adjust the installation of Docker accordingly. Beyond the installation of Docker, the deployment will be the same across the board.
Read to make this happen?
Installing Docker
On the off chance your hosting machine doesn’t already have Docker installed, here’s how it’s done.
The first step is to add the official Docker GPG key with the commands:
Once the above commands are completed, add the required Docker repository with:
You can now install everything with the following command:
You will also have to add your user to the Docker group, so you can actually run the Docker command without sudo privileges. This is done with the command:
Log out and log back in so the changes take effect.
Deploying GitLab
The first step in the deployment is to pull the official GitLab image, which can be done with the following command:
When the pull completes, verify its success with the command:
You should see the GitLab image included in the output.
Next, we’ll deploy the container with the command:
If you’re already using port 8000, you can change that to an unused port. Make sure to do that before you issue the deploy command; otherwise, you’ll have to stop the container, remove it and start all over.
The deployment process will take some time, so either sit back and watch the code fly by or go take care of something else. The entire deployment process can take from 5-20 minutes (depending on the speed of your machine and network). You’ll see a lot of action run output, which might seem to stall; just let it continue to do its thing without interruption.
Accessing GitLab
To make sure everything is up and running, open a browser on your LAN and point it to http://SERVER:8000. You should see a login window (Figure 1).

Figure 1. GitLab is deployed, and now it’s time to log in.
Obviously, you don’t have login credentials, and you can’t simply click a “create account” button for this. Instead, the user is root, and we have to access the container to extract the password.
Since you deployed the container in detached mode (with the -d option), you should have access to the terminal. You’ll need to find the container ID, which can be done with the command:
The output should look something like this:
To access the container, issue the command:
Where ID is the ID of your container.
This will print out the GitLab root password for your instance. You should see something like this in the output:
Do note that the password will be automatically deleted 24 hours after your first login/configuration.
Go back to the GitLab login screen, type root as the username and paste the extracted password into the password field.
You should now find yourself on the main page of your GitLab deployment (Figure 2).

Figure 2. The GitLab main page is fairly straightforward.
Before you begin to use GitLab, you might want to deactivate the ability for anyone to register. You can do this by simply clicking the deactivate button.
And that’s all there is to deploying GitLab to your LAN. Enjoy that fresh new CI/CD smell.