Installing Jenkins on Ubuntu 20.04
What is Jenkins?
Jenkins is the long-time open-source CI/CD server — Java-based, plugin-driven, and probably the most widely deployed self-hosted CI in the world. It's not the prettiest tool around, but it's flexible and well-supported, and it's still the default for plenty of teams. Let's get it installed on Ubuntu.
1. Install Java
Jenkins runs on the JVM. Install OpenJDK 11:
apt install openjdk-11-jdkVerify:
java -versionopenjdk version "11.0.11" 2021-04-20OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)2. Add the Jenkins apt repo
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. Install Jenkins
apt updateapt install jenkinsConfirm it's running:
systemctl status jenkins● jenkins.service - LSB: Start Jenkins at boot time Loaded: loaded (/etc/init.d/jenkins; generated) Active: active (exited) since Mon 2021-09-13 23:30:10 UTC; 9min ago4. Open the firewall
Jenkins listens on port 8080. Open it:
# allow only the 192.168.10.0/24 subnetufw allow proto tcp from 192.168.10.0/24 to any port 8080# or allow from anywhere (only do this on a trusted network)ufw allow 80805. First-run setup
Browse to http://<jenkins-ip>:8080.
Jenkins generates an initial admin password and writes it to disk. Read it:
cat /var/lib/jenkins/secrets/initialAdminPasswordfbeeda0cfc8c43ba8ef91eb84c1bc773Paste it into the Unlock Jenkins screen and click Continue.
The next screen asks whether to install suggested plugins or pick your own.
Pick Install suggested plugins for a sensible starting set. Once they finish installing, Jenkins prompts you to create the first admin user.
Save and continue.
Jenkins is up and ready.
Forcing the UI to English
Jenkins picks UI language from your browser by default, which produces a partly-translated interface. To force English, install the Locale plugin and set the default:
Manage Jenkins → Manage Plugins → AvailableOnce the Locale plugin is installed:
Manage Jenkins → Configure SystemDefault Language: en_US[x] Ignore browser preference and force this language for all usersAfter saving you'll always see English regardless of the browser locale.