Jenkins is an open-source automation server that makes it easy to build CI/CD pipelines. Continuous integration (CI) means team members commit code changes frequently, and automated builds and tests run after each commit to catch problems early. Continuous delivery (CD) takes that a step further by automatically building, testing, and preparing code for production deployment.
Jenkins handles both and integrates with nearly every tool in the DevOps ecosystem, from Git and Docker to Kubernetes and Slack.
This guide shows you how to install Jenkins on Ubuntu 18.04 using the official Jenkins Debian package repository. The same steps work on Ubuntu 16.04.
<strong>Prerequisite:</strong> You need sudo access.
Install Java 8. Jenkins is a Java application and requires OpenJDK 8. The current Jenkins release does not support Java 10 or 11, so use Java 8 specifically:
bashsudo apt updatesudo apt install openjdk-8-jdk
Add the Jenkins Debian repository. Import the Jenkins GPG key so your system trusts packages from the Jenkins repository:
bashwget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
The command prints OK when the key is imported successfully. Add the Jenkins repository to your apt sources:
bashsudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
Install Jenkins. Update the package list and install the latest stable release:
bashsudo apt updatesudo apt install jenkins
Jenkins starts automatically after installation. Confirm it is running:
bashsystemctl status jenkins
Look for Active: active (exited) in the output. Jenkins runs as a service managed by systemd.
Open port 8080. Jenkins listens on port 8080 by default. Allow it through UFW:
bashsudo ufw allow 8080
Open your browser and go to http://your_ip_or_domain:8080. Jenkins shows an unlock screen asking for the initial administrator password. Retrieve it with:
bashsudo cat /var/lib/jenkins/secrets/initialAdminPassword
Copy the 32-character string it prints, paste it into the Administrator password field, and click Continue.
Jenkins asks whether to install suggested plugins or choose your own. Click Install suggested plugins. The suggested set includes support for Git, pipelines, Gradle, Maven, and workspace management. These cover most use cases and are the right choice for a standard Jenkins setup. The installation runs automatically.
Once plugins are installed, you are prompted to create the first administrator account. Fill in your username, password, full name, and email address. Click Save and Continue.
On the next screen, confirm the Jenkins URL, it is pre-filled with the current address. Click Save and Finish.
Click Start using Jenkins and you land on the Jenkins dashboard as the admin user you just created. From here, you can create your first pipeline job and connect it to a code repository.
Jenkins is now installed and running on your Ubuntu 18.04 server. Visit the Jenkins documentation to learn how to set up pipelines, manage credentials, and integrate with your version control system. Leave a comment below if you run into any issues.