How to Install and Set Up Jenkins on Windows, Mac, and Linux: Step-by-Step Guide

Jenkins is a popular open-source automation server that helps automate the parts of software development related to building, testing, and deploying. This guide will walk you through setting up Jenkins on your local machine.
1: Prerequisites
Before installing Jenkins, ensure you have the following:
- Java Development Kit (JDK) 11 or 17: Jenkins requires a compatible version of Java to run.
2: Download and Run Jenkins
- Download Jenkins: Visit the official Jenkins website and download the "Generic Java package (.war)" for the latest stable version.
- Run Jenkins: Open a terminal or command prompt, navigate to the directory where you downloaded the `.war` file, and run the following command:
java -jar jenkins.war
3: Initial Jenkins Setup
- Access Jenkins: Once Jenkins is running, open your web browser and go to `http://localhost:8080`.
- Unlock Jenkins: You will be prompted to unlock Jenkins. The initial administrator password can be found in the file path shown on the screen. You can also find it in the console output from the `java -jar jenkins.war` command.
- Install Plugins: After unlocking, you can choose to "Install suggested plugins" or "Select plugins to install." For beginners, the suggested plugins are a good starting point.
- Create Admin User: Create your first administrator user account.
4: Conclusion
Congratulations! You have successfully installed and set up Jenkins on your system. You can now start creating automation jobs for your projects.
FAQ
Q: How do I change the port Jenkins runs on?
A: You can specify a different port when starting Jenkins by running `java -jar jenkins.war --httpPort=9090`.
Q: How do I stop Jenkins?
A: You can stop Jenkins by pressing `Ctrl+C` in the terminal where you started it.