Rahul Kundra
3 min readFeb 14, 2023

How To Installing, Configuring, and Upgrading Jenkins using War File

Rahul Kundra

Installing Jenkins using War File:

Download the latest Jenkins war file from the official website: https://www.jenkins.io/download/

Open the terminal and navigate to the directory where you want to store the Jenkins war file.

Run the following command to download the war file:

wget http://updates.jenkins-ci.org/download/war/<version>/jenkins.war

Replace <version> with the latest version number of Jenkins.

https://get.jenkins.io/war-stable/2.375.3/jenkins.war

Once the war file is downloaded, run the following command to start Jenkins:

java -jar jenkins.war

This command starts the Jenkins server as a foreground process on port 8080.

To Run Jenkins In Backgoround Use This command runs the Jenkins server as a background process on port 8080, redirects standard output to the file “jenkins.log”, and redirects standard error to the same file. It also redirects standard input from /dev/null, effectively disabling input to the process. The “&” symbol at the end of the command puts the process in the background, allowing the terminal to be used for other commands.

java -jar jenkins.war --httpPort=8080 > jenkins.log 2>&1 </dev/null &

To Change Jenkins Port Use This command runs the Jenkins server as a background process on port 9090, redirects standard output to the file “jenkins.log”, and redirects standard error to the same file. It also redirects standard input from /dev/null, effectively disabling input to the process. The “&” symbol at the end of the command puts the process in the background, allowing the terminal to be used for other commands.

java -jar jenkins.war --httpPort=9090 > jenkins.log 2>&1 </dev/null & 

This command lists all running processes on the system and filters the output to show only those containing the word “java so Can Kill

ps aux | grep java

Configuring Jenkins:

Open a web browser and navigate to the Jenkins web interface by entering the URL http://localhost:8080 in the address bar. If you installed Jenkins on a remote server, replace “localhost” with the IP address or domain name of the server.

On the Jenkins web interface, you will be prompted to enter the initial administrator password. Follow the instructions provided to locate the password file on your system and copy the password into the field.

Once you have entered the administrator password, Jenkins will ask you to set up an administrative user account. Enter your desired username and password and any other required information, and click “Save and Finish.”

Next, you will see a list of recommended plugins to install. Select the option to install the recommended plugins, and wait for the installation process to complete.

Once the plugin installation is complete, you can start creating and running jobs in Jenkins. A job in Jenkins is a set of instructions that tell Jenkins what to do, such as building, testing, and deploying software. To create a new job, click “New Item” on the Jenkins homepage and follow the prompts to specify the job type, name, and other details.

Two methods for updating Jenkins when you have installed it using the WAR

Replace the existing WAR file with the new version:

Download the latest version of the Jenkins WAR file from the official website.

Stop the current Jenkins instance by running the command “CTRL+C” in the terminal or command prompt where Jenkins is running.

Replace the existing Jenkins WAR file with the new one.

Start Jenkins again by running the command “java -jar jenkins.war”.

Wait for the upgrade to complete and verify that all plugins and configurations are still intact.

Use the Jenkins plugin manager:

Log in to the Jenkins web interface as an administrative user.

Click on “Manage Jenkins” in the left-hand navigation menu.

Click on “Manage Plugins” to access the Jenkins plugin manager.

In the “Updates” tab, you should see a list of available updates for plugins that are currently installed in your Jenkins instance.

Select the plugins you want to update and click “Download now and install after restart”.

After the download is complete, click “Restart Jenkins when installation is complete and no jobs are running” to start the upgrade process.

Jenkins will restart and begin installing the updated plugins. This may take some time depending on the size and number of plugins being updated.

Once the installation is complete, log back in to the Jenkins web interface and verify that all plugins are up to date.

I hope this helps! Let me know if you have any further questions.