How To Host Your Own GitLab Server
Tags: git, gitlab
Published: 2021-02-21 19:10:24

##Why GitLab?
Unlike GitHub, GitLab is more optimized for setting up controlled environments. It's similar to GitHub Enterprise. This includes organizational sign-in, more customization capabilities, and better CI/CD.

GitHub is great for personal projects and even team collaboration. GitHub thrives on its amazing community. But if you're looking for something with better change tracking and management tools, GitLab is the way to go.

##Getting Started
I used [Reclaim Cloud](https://reclaim.cloud/) for this tutorial. This is not the only option, but Reclaim is a good choice for hosting since they only charge you for what you use.
![pricing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/scewoexv7jzqmbt741cn.png)
 

##First Things First
1. Head over to the Reclaim Cloud [applications page](https://reclaim.cloud/applications/)
2. Scroll down until you see **DevOps Lab - GitLab Server**
![GitLab Server](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dzbef925jsfiypw88h4s.png)
3. Click **_Install_** and enter your email. Make sure to check your junk folder just in case the confirmation email goes there.
4. Click on the **_DEPLOY NOW_** button in the email. This will take you to the environment setup.
5. Feel free to change your Environment name, Display Name, and Region if needed. Then click **_Install_** 

> Note: You will need to provide payment information as they are providing the server hosting.

**This will take a while** - but you can let that get set up and check your email to be notified whenever it's finished.

##Configuration
Once your environment is set up and ready to go, you can hover over it and click the **_Change Environment Topology_** button. It's the green cog with squares underneath:
 ![cog](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/klo8tfyvkl0u2mvjyojw.png)

![topology](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/emtbs4gu89rf8qb4uakp.png)

This page allows you to allocate resources to your server. I bumped mine up to 10 cloudlets minimum just go give myself a little more breathing room. Depending on the size of your organization, you may need more or less.
![cloudlets](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oq91qspc1z8g9hfdd01i.png)

##Start Using
After you deploy, you'll get an email with the username and password for the root user, which allows you to configure the instance even further.

If you want to import your existing GitHub repos, first sign in. Then on the main page at the top right you can choose **_New project_** which will take you to this screen:
![new project](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/72poxztkxan8febm4ifk.png)

* Select **_Import project_**
* Choose **_GitHub_**

Now you'll need to go to your GitHub [profile settings](https://github.com/settings/tokens) and **generate a new token**.

Be sure to check the box that gives the token full access to your **repos**:
![repo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mng4wbc7vpngcqcy2diu.png)
 
* Generate the token, copy it
* Switch back to your GitLab **Authentication** page to use it
* Click **_Authenticate_**
* Import your GitHub repos

Now all of your projects are backed up on your very own GitLab instance!

##As a recap, check out this video:
{% youtube r0sUrnSAfoA %}