Skip to main content

How To Install Jenkins on Ubuntu 22.04

 How To Install Jenkins on Ubuntu 22.04

 

Prerequisites

To follow this tutorial, you will need

Oracle JDK 11 installed.

 

Step 1 — Installing Jenkins

The version of Jenkins included with the default Ubuntu packages is often behind the latest available version from the project itself. To ensure you have the latest fixes and features, use the project-maintained packages to install Jenkins.

First, add the repository key to your system:

$ wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key |sudo gpg --dearmor -o /usr/share/keyrings/jenkins.gpg

The gpg --dearmor command is used to convert the key into a format that apt recognizes.

Next, let’s append the Debian package repository address to the server’s sources.list:

$ sudo sh -c 'echo deb [signed-by=/usr/share/keyrings/jenkins.gpg] http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'

The [signed-by=/usr/share/keyrings/jenkins.gpg] portion of the line ensures that apt will verify files in the repository using the GPG key that you just downloaded.

After both commands have been entered, run apt update so that apt will use the new repository.

$ sudo apt update

Finally, install Jenkins and its dependencies:

$ sudo apt install jenkins

Now that Jenkins and its dependencies are in place, we’ll start the Jenkins server.

Step 2 — Starting Jenkins

now that Jenkins is installed, start it by using systemctl:

sudo systemctl start jenkins.service

Since systemctl doesn’t display status output, we’ll use the status command to verify that Jenkins started successfully:

$ sudo systemctl status jenkins 

 

If everything went well, the beginning of the status output shows that the service is active and configured to start at boot:

Output

● jenkins.service - Jenkins Continuous Integration Server

     Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled)

     Active: active (running) since Mon 2022-04-18 16:07:28 UTC; 2min 3s ago

   Main PID: 88180 (java)

      Tasks: 42 (limit: 4665)

     Memory: 1.1G

        CPU: 46.997s

     CGroup: /system.slice/jenkins.service

             └─88180 /usr/bin/java -Djava.awt.headless=true -jar /usr/share/java/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 

Now that Jenkins is up and running, adjust your firewall rules so that

you can reach it from a web browser to complete the initial setup.

Step 3 — Opening the Firewall

To set up a UFW firewall, visit Initial Server Setup with Ubuntu 22.04, Step 4- Setting up a Basic Firewall. By default, Jenkins runs on port 8080. Open that port using ufw:

$ sudo ufw allow 8080

Note: If the firewall is inactive, the following commands will allow OpenSSH and enable the firewall:

$ sudo ufw allow OpenSSH

$ sudo ufw enable

Check ufw’s status to confirm the new rules:

You’ll notice that traffic is allowed to port 8080 from anywhere: 

Output

Status: active

 

To                         Action      From

--                         ------      ----

OpenSSH                    ALLOW       Anywhere

8080                       ALLOW       Anywhere

OpenSSH (v6)               ALLOW       Anywhere (v6)

8080 (v6)                  ALLOW       Anywhere (v6)

 

With Jenkins installed and a firewall configured, you have completed the installation stage and can continue with configuring Jenkins.

Step 4 — Setting Up Jenkins

To set up your installation, visit Jenkins on its default port, 8080, using your server domain name or IP address: http://your_server_ip_or_domain:8080

You should receive the Unlock Jenkins screen, which displays the location of the initial password:

 Unlock Jenkins screen

 

In the terminal window, use the cat command to display the password:

$ sudo cat /var/lib/jenkins/secrets/initialAdminPassword

Copy the 32-character alphanumeric password from the terminal and paste it into the Administrator password field, then click Continue.

The next screen presents the option of installing suggested plugins or selecting specific plugins:

Customize Jenkins Screen

 

We’ll click the Install suggested plugins option, which will immediately begin the installation process.

Jenkins Getting Started Install Plugins Screen

 

  When the installation is complete, you’ll be prompted to set up the

first administrative user. It’s possible to skip this step and continue

as admin using the initial password from above, but we’ll take a moment to create the user.

Jenkins Create First Admin User Screen

 

Enter the name and password for your user:

Jenkins Create User

 

 

You’ll receive an Instance Configuration page that will ask you to confirm the preferred URL for your Jenkins instance. Confirm either the domain name for your server or your server’s IP address:

Jenkins Instance Configuration

 

 After confirming the appropriate information, click Save and Finish. You’ll receive a confirmation page confirming that “Jenkins is Ready!”:

Jenkins is ready screen

 

Click Start using Jenkins to visit the main Jenkins dashboard:

Welcome to Jenkins Screen

 

At this point, you have completed a successful installation of Jenkins.

 

Top of Form

Bottom of Form

 

Comments

Popular posts from this blog

Vicidial Scratch installation Alma -9

Step 1 – Download the dependencies   hostnamectl set-hostname xxxxxx.xxxxx.xxx ### Use YOUR SubDomain vi /etc/hosts ##Change domain name for actual server ip (xxx.xxx.xxx.xxx   complete domain name    subdomain only) timedatectl set-timezone Asia/Kolkata yum check-update yum update -y yum -y install epel-release yum update -y yum install git -y yum install -y kernel* sudo dnf install kernel-devel-$(uname -r) -y #Disable SELINUX sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config     reboot Step 2 – Run the Script cd /usr/src/ git clone https://github.com/manish23k/vicidial-install-scripts cd vicidial-install-scripts chmod +x alma-rocky9-ast16.sh ./alma-rocky9-ast16.sh Or the Asterisk 18 version: chmod +x alma-rocky9-ast18.sh ./alma-rocky9-ast18.sh ####For PHP 8 use this script. chmod +x main-installer-php8.sh ./main-installer-php8.sh

How to delete old call logs and other logs in vicidial or goautodial.

Step 1 : SSH to the server using the Putty Step 2:   login to mysql by typing   mysql -p                    (if you dont know password try below command )               mysql -ucron -p1234 Step 3 : select the asterisk database by typing               use asterisk step 4: Run the below command to check total disk occupied by asterisk database                SELECT table_schema AS "asterisk", ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema; Step 5 : Run the below command to check disk space consumed by each table in asterisk database SELECT table_name AS "Table", ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" FROM information_schema.TABLES WHERE table_schema = "asterisk" ORDER BY (data_length + inde...

Install the No-IP client (Dynamic Update Client) on AlmaLinux 9

 Install the No-IP client (Dynamic Update Client) on AlmaLinux 9 1. Install Required Packages First, install the necessary packages to compile the client from source. sudo dnf install gcc make wget tar 2. Download the No-IP DUC (Dynamic Update Client) Download the latest version of the No-IP DUC. cd /opt wget https://www.noip.com/client/linux/noip-duc-linux.tar.gz 3. Extract the Downloaded File Extract the downloaded tarball. tar -zxvf noip-duc-linux.tar.gz cd noip-2.1.9-1/ 4. Compile the Client Run the following commands to compile the client. sudo make install 5. Configure the No-IP Client After installation, you’ll be prompted to enter your No-IP account credentials (email and password) and choose the hostname(s) to update. If not, you can manually run the configuration: sudo /usr/local/bin/noip2 -C 6. Start the No-IP Client To start the client: sudo /usr/local/bin/noip2 7. Verify Installation To confirm that the No-IP DUC is running, use: sudo /usr/local/bin/noip2 -S 8. Set Up...