GitLab

How To Setup A GitLab Server The Easy Way

In this post I am going to show you 2 different ways to setup your own GitLab server in just a few minutes. The first option is a live DigitalOcean droplet (virtual server) that will have a dedicated IP address, start at $10/month and will be production ready. The second option uses the official Docker container, is completely free and can be used in a production environment.

How To Setup A GitLab Server The Easy Way With DigitalOcean

The quickest way to start your own server is to use the one-click app option on DigitalOcean. It really is as easy as it sounds. If you don’t already have a DigitalOcean account, click here to get started.

Just click the big green Create Droplet button at the top of the site and select GitLab image under the One-click apps tab.

Then choose an appropriate droplet size, starting with the $10/month option as the application tends to hang on the smaller $5/month droplet.

Now you can choose a data center closest to you and give it a name. Then click create and within a couple of minutes, your server will be live and waiting for you to manage your next project!

How To Setup A GitLab Server The Easy Way With Docker

The other quick way to get started is to use the official Docker container. If you’ve used Docker before, then this will be super simple for you as you’ve likely already installed it and can skip a whole step.

Not using Docker yet? You can visit Docker’s website for installation instructions. Once you have Docker installed you can create a new container by running the following command in your terminal:

docker pull gitlab/gitlab-ce

You have now pulled the official Docker image and can now run the container using a command similar to the one below:

docker run --detach \
	--hostname gitlab.example.com \
	--publish 443:443 --publish 80:80 --publish 22:22 \
	--name gitlab \
	--restart always \
	--volume /srv/gitlab/config:/etc/gitlab \
	--volume /srv/gitlab/logs:/var/log/gitlab \
	--volume /srv/gitlab/data:/var/opt/gitlab \
	gitlab/gitlab-ce:latest

You can find more details on how to modify this command for your needs in the documentation here.

That’s it, two ways to get started with your own server in a matter of minutes using DigitalOcean or Docker!

%d bloggers like this: