DEV Community

Cover image for How to Manually Install Jenkins on AWS EC2 Linux
Dickson Victor for AWS Community Builders

Posted on • Updated on

How to Manually Install Jenkins on AWS EC2 Linux

Have you tried installing jenkins on ubuntu server severally without success? Do you get the following error message when you try to install jenkins?

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package jenkins is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'jenkins' has no installation candidate
Enter fullscreen mode Exit fullscreen mode

Then, its time to install manually. Follow the steps listed below.

  1. Install Java: Jenkins requires Java to run. You can install OpenJDK 8 using the following command:
sudo apt-get update
sudo apt-get install openjdk-8-jdk
Enter fullscreen mode Exit fullscreen mode
  1. Download the Jenkins WAR file: Go to the official Jenkins website and download the latest Jenkins WAR file. You can use the following command to download the latest WAR file:
wget https://updates.jenkins-ci.org/latest/jenkins.war
Enter fullscreen mode Exit fullscreen mode
  1. Start Jenkins: Start Jenkins using the following command:
java -jar jenkins.war
Enter fullscreen mode Exit fullscreen mode
  1. Access Jenkins: Open a web browser and navigate to http://public-ip:8080 to access the Jenkins web interface.

jenkins

  1. Complete the setup: Follow the instructions on the Jenkins setup screen to complete the installation process. To obtain the initial passwod, run:
cat /home/clouduser/.jenkins/secrets/initialAdminPassword
Enter fullscreen mode Exit fullscreen mode

Note: By default, Jenkins will run on port 8080. If port 8080 is already in use on your system, you can specify a different port using the --httpPort option when starting Jenkins. For example, to start Jenkins on port 9090, you can use the following command:

java -jar jenkins.war --httpPort=9090
Enter fullscreen mode Exit fullscreen mode

I hope these steps help you to install Jenkins manually.

Top comments (0)