Back to blog
backend December 16, 2019

Install Jenkins on Ubuntu 18

Create a VPS on Digitalocean, AWS or wherever you want. Since it's a new machine we want to update the repositories:

sudo apt-get update

Jenkins runs on Java 8, so now we are going to install it:

sudo apt-get install openjdk-8-jdk wget gnupg
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9B7D32F2D50582E6
sudo apt-get update
sudo apt-get install git jenkins

Now we are going to create a SSH key for jenkins:

ssh-keygen

To make sure Jenkins is running:

service jenkins status
service jenkins start

Jenkins will be running on port 8080. Get the initial password:

cat /var/lib/jenkins/secrets/initialAdminPassword