How Do You Install Jenkins 2.x on Debian Linux in Google Cloud Platform?

Problem scenarios
#1  You have a Debian server in GCP with roughly 0.592 GB of RAM.  You want to install Jenkins on it.  How do you do this?

OR

#2  You have a nano flavor of an EC2 instance running Ubuntu Linux (i.e., 0.5 GB of RAM).  You want to install Jenkins on it.  How do you install Jenkins 2.x on Ubuntu Linux in AWS?  (If you do not want to install a "apt-transport-https" package, but you can run "apt-get upgrade", then see this posting.)

Solution
(The directions were tested separately in both AWS and GCP.)

1.  Run these commands from the command line prompt of the Debian Linux server:

sudo apt-get -y update 
sudo apt-get -y install apt-transport-https
wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
echo deb https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list
sudo apt-get -y update
sudo apt-get -y install jenkins
sudo systemctl start jenkins
curl http://icanhazip.com
 # to find the external IP address of the server

2.  Go back to your workstation and open a web browser.  Go to this URL where x.x.x.x is the IP address obtained from the curl command above:  http://x.x.x.x:8080

Ensure (e.g., in the GCP console) that the relevant firewall rule allows for inbound connections over port 8080 (unless you configured a different port) from your workstation.  If you are not sure how, see this posting.  If you are running the server in AWS, ensure that the Security Group allows for connectivity.

3.  In the web browser, enter the initial password.  You may need to use sudo to access the file from the Linux back-end after you see the path to the file is shown in the web browser.  You will then click choose "Install Suggested Plugins."  Enter the fields as requested for the "First Admin User."  Click "Save and Finish."  You are done.

FYI
A server with 0.5 GB of RAM will be sufficient for Jenkins as a development test server.  If you will put a considerable load on Jenkins, you will need a server with more memory.  To resize a server in AWS, see this posting.  To resize a server in GCP, see this posting.

Leave a comment

Your email address will not be published. Required fields are marked *