Installation
Ubuntu 22/24
Before installing any packages, ensure your system is up to date
sudo apt update
sudo apt upgrade -yJenkins requires Java to run. Jenkins currently supports Java 11. Install the OpenJDK 11 package: (If java installed neglect the below this step)
sudo apt install openjdk-11-jdk -yVerify the Java installation by running:
java -versionImport Jenkins key to authenticate the repository:
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
Add Jenkins repository to your system's package list:
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
Now that Jenkins' repository is added, update the package list again:
sudo apt updateThen install Jenkins:
sudo apt install jenkins -yOnce the installation is complete, start the Jenkins service:
sudo systemctl start jenkinsEnable the Jenkins service to start on boot:
sudo systemctl enable jenkinsAllow port 8080 through the firewall:
sudo ufw allow 8080Reload the firewall to apply changes:
sudo ufw reloadTo access Jenkins, open your web browser and enter your server's IP address or domain name, followed by port 8080:
http://your_server_ip_or_domain:8080
When you first access Jenkins, it will ask you for an admin password.
Retrieve the password by running this command:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Click Install suggested plugins for a default setup.
Wait while Jenkins installs the plugins.
Step 10: Create an Admin User
Once the plugins are installed, Jenkins will prompt you to create your first admin user.
Fill in the required fields (username, password, etc.) to create the admin user.
Click Save and Finish.
CentOS 7
Install Jenkins on CentOS 7
Step 1: Login and Switch to Root User
sudo suStep 2: Install Required Dependencies
yum install -y wget epel-releaseStep 3: Add the Jenkins Repository
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo --no-check-certificateStep 4: Import Jenkins Public Key
rpm --import https://pkg.jenkins.io/redhat/jenkins.io.keyStep 5: Install Java (Required for Jenkins)
yum install -y java-11-openjdk-develStep 6: Install Jenkins
yum install -y jenkinsStep 7: Start and Enable Jenkins Service
systemctl start jenkins
systemctl enable jenkinsStep 8: Check Jenkins Status
systemctl status jenkinsStep 9: Retrieve Initial Admin Password
cat /var/lib/jenkins/secrets/initialAdminPasswordReference:
Last updated