Installation Guide
System Requirements
Before installing Jenkins, ensure your system meets the following minimum requirements:
Minimum Recommended Configuration
- 256MB of available memory
- 1GB of available disk space (10GB recommended when running as a Docker container)
Recommended Configuration for Small Teams
- 1GB+ of available memory
- 50GB+ of available disk space
Software Requirements
- Java 8 or higher (either JRE or JDK)
- Note: If running Jenkins as a Docker container, Java does not need to be installed on the host
Installation Platforms
Jenkins supports multiple installation methods. This guide covers the most commonly used approaches.
Docker Installation
Docker is the recommended way to install Jenkins as it provides an isolated environment and simplifies configuration.
Installing Docker
First, install Docker on your system. Visit the Docker official website and choose the appropriate Docker Community Edition version for your operating system.
Downloading and Running Jenkins
On macOS and Linux, open a terminal and run:
docker run \
-u root \
--rm \
-d \
-p 8080:8080 \
-p 50000:50000 \
-v jenkins-data:/var/jenkins_home \
-v /var/run/docker.sock:/var/run/docker.sock \
jenkinsci/blueocean
On Windows, open a command prompt and run:
docker run ^
-u root ^
--rm ^
-d ^
-p 8080:8080 ^
-p 50000:50000 ^
-v jenkins-data:/var/jenkins_home ^
-v /var/run/docker.sock:/var/run/docker.sock ^
jenkinsci/blueocean
Parameter explanations:
-u root: Run container as root user--rm: Automatically delete container when stopped-d: Run in background (detached mode)-p 8080:8080: Map container port 8080 to host port 8080-p 50000:50000: Map container port 50000 to host port 50000 (for JNLP agent communication)-v jenkins-data:/var/jenkins_home: Persist Jenkins data-v /var/run/docker.sock:/var/run/docker.sock: Allow Jenkins to run Docker commands in pipelinesjenkinsci/blueocean: Official Jenkins image with Blue Ocean interface
Accessing Jenkins Container
To access the Jenkins container internals, use:
docker exec -it jenkins-blueocean bash
Viewing Jenkins Logs
View Jenkins console logs with:
docker logs jenkins-blueocean
WAR File Installation
The Jenkins WAR file version can be installed on any operating system that supports Java.
Installation Steps
- Download the latest stable Jenkins WAR package from the official website
- Open a terminal in the download directory
- Run:
java -jar jenkins.war - Browse to http://localhost:8080 and wait for the Unlock Jenkins page
Notes
- WAR file installation does not automatically install Blue Ocean; it needs to be installed separately through plugin management
- You can change the port using
--httpPort, e.g.,java -jar jenkins.war --httpPort=9090
macOS Installation
Using Package Installer
- Download the macOS Jenkins package
- Double-click to open and follow the installation wizard
Using Homebrew
Install latest version:
brew install jenkins
Install LTS version:
brew install jenkins-lts
Linux Installation (Debian/Ubuntu)
On Debian-based distributions, install Jenkins via apt:
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
After installation, Jenkins will:
- Set up to start as a daemon at boot
- Create a jenkins user to run the service
- Output logs to /var/log/jenkins/jenkins.log
- Listen on port 8080 by default
Post-Installation Setup Wizard
After starting Jenkins for the first time, the setup wizard begins.
Unlocking Jenkins
- Browse to http://localhost:8080
- When the Unlock Jenkins page appears, copy the automatically generated password from the console log
- Paste the password into the administrator password field and click Continue
Customizing Jenkins Plugins
On the plugin installation page, choose:
- Install suggested plugins: Installs a recommended set of plugins based on common use cases
- Select plugins to install: Manually choose which plugins to install
Creating First Admin User
Finally, create an administrator account by providing:
- Username
- Password
- Confirm password
- Full name
- Email address
Click Save and Finish, then click Start using Jenkins to access the main interface.
Verifying Installation
Verify the installation by:
- Browsing to http://localhost:8080
- Logging in with the created admin account
- Checking system status
Common Issues
Port Already in Use
If port 8080 is in use by another program:
- Docker method: Modify the -p parameter
- WAR method: Use --httpPort parameter
Insufficient Memory
If system memory is limited:
- Use Docker with container resource limits
- Adjust JVM heap size in Jenkins startup parameters
Slow First Start
First startup downloads and installs plugins, which may take time. Please be patient.
Next Steps
After installation, learn how to:
- Create your first pipeline job
- Configure source code (such as Git)
- Set up build triggers
- Integrate testing and deployment tools
