Jenkins - Installation
Jenkins - Installation Guide
Section titled “Jenkins - Installation Guide”Download Jenkins
Section titled “Download Jenkins”The official website for Jenkins is https://www.jenkins.io/. Navigate to the download section: https://www.jenkins.io/download/
You will typically find two main release lines:
- LTS (Long-Term Support): Stable releases recommended for production environments. Updated less frequently but receive critical bug and security fixes.
- Weekly: Latest features and updates, suitable for testing or environments where having the newest functionality is prioritized over stability.
Choose the release line appropriate for your needs. You can download:
- Generic Java package (.war): Platform-independent, can be run standalone or deployed in a servlet container.
- Platform-specific packages: Installers or packages for Docker, Windows, macOS, and various Linux distributions (Debian/Ubuntu, Red Hat/CentOS/Fedora, etc.). These often set up Jenkins to run as a service.
For this guide, we’ll focus on the generic .war file for simplicity.
Starting Jenkins (using .war file)
Section titled “Starting Jenkins (using .war file)”-
Ensure you have a compatible Java Runtime Environment (JRE) installed (Java 11 or 17 recommended - check current Jenkins docs for specifics).
-
Open your terminal or command prompt.
-
Navigate to the directory where you downloaded
jenkins.war. -
Run the command:
java -jar jenkins.war --httpPort=8080(You can change 8080 to another port if needed).
Jenkins will start up, using an embedded Jetty web server. You’ll see log messages in the console, including:
INFO: Jenkins is fully up and runningNote: By default, Jenkins stores its data in a .jenkins directory in your user’s home folder. You can change this using the JENKINS_HOME environment variable or system property. See the Configuration chapter for details.
Initial Setup Wizard
Section titled “Initial Setup Wizard”-
Once Jenkins is running, open your web browser and navigate to
http://localhost:8080(or the port you specified). -
Unlock Jenkins: You’ll be prompted to enter an initial administrator password. Jenkins displays the path to this password file (
initialAdminPassword) in the console output during startup. Copy the password from that file and paste it into the browser field.
Example console output showing the password location:
*************************************************************
Jenkins initial setup is required. An admin user has been created and a password generated.Please use the following password to proceed to installation:
[Long alphanumeric password string here]
This may also be found at:/path/to/your/jenkins_home/secrets/initialAdminPassword
*************************************************************-
Customize Jenkins (Install Plugins): You’ll be asked to install plugins. You can choose ‘Install suggested plugins’ (recommended for beginners) or ‘Select plugins to install’.
-
Create First Admin User: Set up the username, password, full name, and email address for the primary Jenkins administrator account.
-
Instance Configuration: Confirm the Jenkins URL (usually auto-detected correctly).
-
Jenkins is Ready: The setup is complete! Click ‘Start using Jenkins’ to access the Jenkins dashboard.
Other Installation Methods (Briefly)
Section titled “Other Installation Methods (Briefly)”Docker: A highly recommended method. Use the official Jenkins Docker images (e.g., jenkins/jenkins:lts). This simplifies dependency management and upgrades. Example:
docker run -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins:ltsNative Packages: Using apt, yum, brew, or Windows installers sets up Jenkins as a system service, making it easier to manage (start/stop/restart).
Refer to the official Jenkins documentation for detailed instructions on these methods: https://www.jenkins.io/doc/book/installing/