Install GitLab & Jenkins on CentOS 7

Grant Foster
Apr 11, 2020 · 3 min read

If you’re new to DevOps or CI/CD and want to get started using the tools without having to configure multiple servers or networks, then installing GitLab and Jenkins on the same machine can expedite your configuration and allow you to focus on learning the tools themselves.

Disclaimer: This type of configuration is not recommended for production, but is meant to serve as a first step in learning how to implement CI/CD.

By the end of this post, you will have GitLab and Jenkins installed on the same CentOS 7 server, with GitLab listening on the default HTTP port (80) and Jenkins listening on port 8081.

Afterward, see this post to learn how to automatically trigger a Jenkins build by pushing to a GitLab repository.

Step 1: Install GitLab

Install dependencies and configure the system firewall to allow HTTP/S (although this tutorial will just deal with HTTP):

Add the GitLab package repository:

Install GitLab, passing in the host URL you want to access it from. In our case, it will just be http://localhost (port 80 by default):

Verify installation by going to http://localhost in your web browser. If you encounter an error, make sure there are no other services already listening on port 80. Also, port 8080 should be free as that is the port the internal Unicorn daemon listens on.

Enter in a new password and then sign in as root with the password you just created. You should then see the welcome page:

Step 2: Install Jenkins

Install Java, add the Jenkins package repository, and install Jenkins:

Edit the Jenkins configuration file so that Jenkins listens on port 8081 instead of the default 8080:

Allow port 8081 through the system firewall:

Start the Jenkins service:

In your web browser, go to http://localhost:8081

Copy the administrator password from the specified location and enter it in.

Click Install suggested plugins and wait for the plugins to install.

Create the admin user.

Ensure the Jenkins URL is http://localhost:8081 and click Save and Finish.

Sign in with your new admin credentials and you should see this screen:

Congratulations! You have successfully installed GitLab and Jenkins on CentOS 7. See this post to learn how to configure Jenkins to automatically build Java projects from GitLab.

The Startup

Get smarter at building your thing. Join The Startup’s +724K followers.

Grant Foster

Written by

Developer

The Startup

Get smarter at building your thing. Follow to join The Startup’s +8 million monthly readers & +724K followers.

Grant Foster

Written by

Developer

The Startup

Get smarter at building your thing. Follow to join The Startup’s +8 million monthly readers & +724K followers.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store