
Jenkins is an open-source self-contained Java automation program used as a Continuous integration and delivery tool.
It offers a variety of plugins, is extensible, distributed, and can be easily configured.
In this blog post, we will install and configure Jenkins with Apache as a web server so we can access it via a domain name.
Installing Jenkins on Ubuntu 22.04 is straightforward and may take up to 10 minutes. Let’s get started!
Table of Contents
Prerequisites
- A server with Ubuntu 22.04 as OS
- Valid domain pointed to the servers IP address
- User privileges: root or non-root user with sudo privileges
Step 1. Update the System
Update the packages to their latest versions available after a fresh install of Ubuntu 22.04
Step 2. Install Apache Web Server
To install the Apache Web server execute the following command:
Once installed, start and enable the service.
Check if the service is up and running:
You should receive the following output:
Step 3. Install Java
To install Java OpenJDK 11, execute the following command:
To check the installed Java version, execute the following command:
You should receive the following output:
Step 4. Install Jenkins
First, we will add the Jenkins repository and Key since they are not added by default in Ubuntu 22.04:
Update the system and install Jenkins:
Once installed, start and enable the Jenkins service:
To check the status of the service:
You should get the following output:
Step 5. Setting up Apache as a Reverse Proxy
To access Jenkins installation via domain, we need to configure the Apache as a Reverse Proxy:
Since Apache is already installed in the previous steps, you need to create the jenkins.conf configuration file:
Paste the following lines of code, save and close the file.
Once you save and close the file, you need to execute the following commands:
After enabling the Apache configuration and restarting the Apache service, you will be able to access your Jenkins via your domain.
Step 7. Finish Installation
To finish the installation, access your Jenkins installation at http://yourdomain.com
Enter the password from /var/lib/jenkins/secrets/initialAdminPassword and hit continue. To get the password to execute the following command:
On the next window, click on the suggested plugins:
The installation process will start:
On the next window, set your admin username, password and admin email.
In the last step, you will get the URL you entered before. Click on the “Save and Finish” button.
You can start using Jenkins now:
Clicking on “Start using Jenkins” will get you in the administrator dashboard.
Congratulations! You successfully installed Jenkins with Apache as a reverse proxy on Ubuntu 22.04. If you have any difficulties with the installation process, you can contact our technical support, and they will install and configure Jenkins for you. We are available 24/7. All you need to do is to sign up for one of our NVMe VPS plans and submit a support ticket.
If you liked this post on how to install Jenkins on Ubuntu 22.04, please share it with your friends on social networks or simply leave a reply below. Thanks.