Install Jenkins on Ubuntu or Linux

Tiempo de lectura: 2 minutos

Reading time: 2 minutes

In this tutorial, I’m going to show you how to install Jenkins on Ubuntu or Linux:

Jenkins is an open-source Continuous Integration and Delivery (CI/CD) system. It allows you to automate the build, testing, and deployment of software applications, making it easier to deliver new features and fixes faster and more reliably.

In addition, Jenkins offers a wide range of plugins that extend its capabilities and make it compatible with a variety of technologies and development tools.

The first thing you need to do is install the Java Development Kit (JDK):

sudo apt install openjdk-11-jdk

Once installed, let’s install Jenkins on the machine:

sudo apt install jenkins

Now, to start Jenkins, use the following command:

sudo systemctl start jenkins

To allow access to Jenkins on the default port 8080, add the exception in iptables (here’s how to open ports on Ubuntu or Linux):

sudo iptables -I INPUT -p tcp --dport 8080 -j ACCEPT   

Once the port is open, let’s access it in our browser by entering:
http://localhost:8080 (localhost or the remote machine’s IP address)

The following webpage will appear to unlock Jenkins.

You can obtain the password in the following path:

sudo vi /var/lib/jenkins/secrets/initialAdminPassword 

Once obtained, enter the password and start the installation.

In my case, I have selected Install suggested plugins to perform a default installation.

Once installed, let’s create the admin user by filling in the requested information.

Finally, add the URL in the configuration, you can leave the default one. If no URL appears, you will need to enter the URL that was opened in the previous step: http://localhost:8080 (localhost or the remote machine’s IP address)

Finally, we have Jenkins installed and ready to use.

Don’t miss our tutorials.

Leave a Comment