
{{ $('Map tags to IDs').item.json.title }}
Installing Jenkins on Ubuntu
Jenkins is a popular open-source automation server used to automate the building, testing, and deploying of software. This tutorial will guide you through the process of installing Jenkins on an Ubuntu server.
Prerequisites
- A server running Ubuntu (preferably version 20.04 or later).
- Root or sudo privileges to install software.
- Java Development Kit (JDK) installed on the system.
1. Installing Java
Jenkins requires Java to run. To install the OpenJDK version of Java, run the following commands:
sudo apt update
sudo apt install openjdk-11-jdk -y
After installation, verify that Java is installed:
java -version
2. Adding the Jenkins Repository
Before installing Jenkins, you need to add the Jenkins repository key and repository:
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
3. Installing Jenkins
Now, update your package index and install Jenkins:
sudo apt update
sudo apt install jenkins -y
4. Starting the Jenkins Service
After installation, start the Jenkins service:
sudo systemctl start jenkins
To enable Jenkins to start at boot, run:
sudo systemctl enable jenkins
5. Configuring Firewall
Jenkins runs on port 8080 by default. If you have a firewall running, you’ll need to allow traffic on this port:
sudo ufw allow 8080
Check if the firewall is active:
sudo ufw status
6. Accessing Jenkins Web Interface
Open your web browser and go to:
http://your_server_ip:8080
Replace your_server_ip
with the actual IP address of your server.
7. Unlocking Jenkins
Upon first access, you will be prompted to unlock Jenkins. To find the initial admin password, run:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Copy the displayed password and paste it into the unlock screen in your browser.
8. Setting Up Jenkins
After unlocking, you can customize your Jenkins installation. You will have options to install suggested plugins or select specific plugins. Follow the prompts to complete the setup.
9. Creating Your First Admin User
Once the plugins are installed, you’ll be prompted to create your first admin user. Provide the necessary information and save it.
10. Conclusion
You have successfully installed Jenkins on Ubuntu. Jenkins provides an excellent platform for Continuous Integration and Continuous Deployment (CI/CD). Now you can start configuring your projects and pipelines!