1. Download the latest version of Jenkins for Raspberry Pi from the official Jenkins website.
2. Extract the downloaded file and move it to the /opt directory.
3. Change the permissions of the extracted file to make it executable.
4. Run the Jenkins installation script.
5. Follow the on-screen instructions to complete the installation.
6. Once the installation is complete, start the Jenkins server.
7. Access the Jenkins web interface by entering the IP address of your Raspberry Pi in a web browser.
8. Log in to the Jenkins web interface using the default username and password.
9. Configure the Jenkins server according to your needs.
If you are a serious developer, you might be looking for tools to make your life easier and your applications more reliable. Jenkins is one solution you can use to build and test your software projects, and the good news is that it can be installed on Raspberry Pi.
Jenkins is an automation server which is not available in the Raspberry Pi OS repository. To install it, a new repository need to be added, it also required the Java JDK to works.
Don’t worry, I’ll show you step-by-step how to do this on your Raspberry Pi in this tutorial. I’ll start by an introduction and we’ll quickly move to the installation and configuration.
If you’re looking to quickly progress on Raspberry Pi, you can check out my e-book here. It’s a 30-day challenge where you learn one new thing every day until you become a Raspberry Pi expert. The first third of the book teaches you the basics, but the following chapters include projects you can try on your own.
What is Jenkins?
Introduction
Jenkins is an open-source automation server.
It helps developer teams in building, testing, deploying and automating any project.
You can enjoy the 1000+ available plugins to adapt Jenkins to your environment.
For example, you can integrate it with GitHub, LDAP or add email notifications.
Features
The Jenkins project puts the following qualities forward on its home page:
- Continuous Integration and Continuous Delivery: You can tune your Jenkins server to a simple CI Server, or to integrate in real time any change the developer team made on the public hub
- Easy Installation: as you’ll see in the next paragraph, Jenkins is easy to install on any platform, and Raspberry Pi is perfect for this
- Easy Configuration: you can change everything from the web interface
- Plugins: like I already mentioned in the introduction, there are hundreds of plugins available to fit your needs
- Extensible: this goes along with the previous point, but you can easily improve Jenkins with all the available free plugins
Video
To see Jenkins in action, you can check this demonstration video:
Jenkins’s installation guide
Now let’s dive into the Jenkins installation steps, it’s easy with all the commands below.
Here are the required steps to install Jenkins on Raspberry Pi:
- Install and update Raspberry Pi OS.
- Install Java.
- Add the Jenkins repository and install the corresponding package.
- Unlock the access to the web interface to configure it.
Install Raspberry Pi OS
The first thing you need is a working Raspberry Pi OS installation.
You can start with Raspberry Pi OS Lite, it’s OK because you don’t need a GUI for Jenkins, everything is available on the web interface.
If you already have any Raspberry Pi OS installed on your Raspberry, it’s fine, follow this installation guide with it.
If not, you need to install Raspberry Pi OS on it, and you can follow this Raspberry Pi OS installation guide if you need help to do this.
In any case, make sure you have:
- Internet working (ping google.com)
- Updated your system:
sudo apt update
sudo apt upgrade - Enabled an SSH access:
sudo service ssh start
- Taken note of the Raspberry Pi IP Address
ifconfig
When everything is correct, you can move to the next paragraph.
Are you a bit lost in the Linux command line? Check this article first for the most important commands to remember, and a free downloadable cheat sheet so you can have the commands at your fingertips.
Prerequisites: install java
Jenkins needs Java to run the server.
So, you need to install Java JDK before everything else:
- Install the Java SDK from the apt repository
sudo apt install openjdk-11-jdk -y
- After the installation, you can make sure that Java is correctly installed with:
java -version
- You should get something like this:
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment (build 11.0.12+7-post-Raspbian-2deb10u1)
OpenJDK Server VM (build 11.0.12+7-post-Raspbian-2deb10u1, mixed mode)
If you experience any issue with this installation, I have an entire tutorial on how to install any Java version on Raspberry Pi.
Install Jenkins
Then, to install Jenkins on your Raspberry Pi, you need to add a new repository (to get the latest version):
- Download the repository key:
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
- Add the new repository URL to your apt sources
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
- Update the apt cache
sudo apt update
- And finally install Jenkins
sudo apt install jenkins
This step will install Jenkins, create a Jenkins user to run the daemon, and create default configuration and log files.
This will also install the web interface we’ll enable in the next paragraph.
Unlock Jenkins
After the installation, Jenkins is immediately available on http://IP_ADDRESS:8080.
But on your first try, you’ll get an “error screen” indicating that Jenkins is locked:
This is a security measure to avoid anyone accessing the configuration interface before the administrator can configure it. Follow these steps to unlock the access:
That’s it, Jenkins is running on your Raspberry Pi, and you can start hosting your projects on it.
Remember that the Raspberry Pi storage is not unlimited, so for big projects it’s probably not a good idea to send everything on the Raspberry Pi. You should at least use an external USB drive to store your projects, even a cheap one (like this one on Amazon) will be way safer than your SD card.
Jenkins configuration
In this section, I’ll give you some tips to configure and monitor your new Jenkins server.
Start and stop the Jenkins service
Jenkins is well integrated with Raspberry Pi OS/Debian, so it’s easy to manage the Jenkins service.
If something goes wrong, you can check the Jenkins service status, or start/stop it, if needed.
- Check the Jenkins service current status
sudo service jenkins status
- Start the service
sudo service jenkins start
- Stop the service
sudo service jenkins stop
Configuration files
Generally, you can do everything from the web interface, so most of the time you don’t need to edit the configuration files.
If for some reason you want to check them, Jenkins stores all files in the /var/lib/jenkins folder.
Log files
Jenkins also uses the default /var/log folder to save logs files.
You can check the /var/log/jenkins/ directory for the latest logs.
But you can also read them from the web interface.
Other configuration tasks
For anything else, you can check the “Manage Jenkins” entry in the main menu.
You’ll get something like this:
From there, you can edit everything you want to adapt your configuration to your specific needs.
You can also manage your users from this menu.
Jenkins usage
Finally, I’ll give you here some basic advice to start with Jenkins if you are new with this software.
Install new plugins
The first thing to consider is to install new plugins, especially if you got the “Offline page” during the installation.
Go to Manage Jenkins > Manage plugins.
In my case, I had this error on the page:
There were errors checking the update sites: SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
If you have the same thing, you can go to the “Advanced” tab.
Then in the “Update Site” field, replace https with http in the URL.
Click on Submit, it should be OK now (if not, click “Check updates” on the “Manage plugins” home page).
Finally, go to the “Available” tab and look for the plugins you need to install.
You can use the search engine on the top to filter the list.
You can also check for plugins on the official website, I find it more convenient.
Create a basic project
Now, let’s say you want to create a new project on Jenkins:
- The first thing to do is to go back to the home page and click “Create new jobs”.
- Enter a project name and select the project type corresponding to your code.
If you installed some plugins, you will probably get the choice between projects type (GitHub, Subversion, …)
If not, start with the “Freestyle Project”. - On the next page, you’ll get the project details that you can fill with your information.
You can for example select the source code management tool (Git or Subversion if installed).
You can also choose triggers to automatically launch a build. - When everything is fine, click on Save to access the workspace.
You can always go back to the previous configuration form with the “Configure” menu in the left menu.
You can now manage everything with the left menu in your project:
Backup your project
Even if you can try to back up the Jenkins folder to keep your projects safe, the best option is to install a backup plugin:
- Go to Manage Jenkins > Manage plugins.
- In the available tab, look for “Backup Plugin”.
- Install it.
- After the installation, you’ll get a new link in Manage Jenkins : “Backup Manager”.
- Click on “Setup” and configure it as you want.
If you choose a local folder for the backups, don’t forget to copy them elsewhere for more security.
Going further
As everything after your project creation highly depends on what kind of project you want to host on Jenkins, I’ll let you check the official documentation for specific questions.
You can also use different tools to discuss with Jenkins users.
You have everything you need on this page, to find the way you prefer to communicate with them.
Related questions
Is it possible to move Jenkins to another server (hardware) if my Raspberry Pi is full? Yes, you can use the Backup Manager tool I showed you previously to create a full backup, and import it on another server. So, you can try Jenkins on Raspberry Pi and move to something more powerful in a second step.
Is there a way to use Jenkins in a Docker container? Yes, absolutely. It’s even the recommended method for many platforms. You can find all the information on this Docker page.
Want to chat with other Raspberry Pi enthusiasts? Join the community, share your current projects and ask for help directly in the forums.
Conclusion
And that’s it! You know now everything you need to install and configure Jenkins for your Raspberry Pi.
The installation is straightforward, but the usage can be a little tricky at the beginning if you never used Jenkins before.
I’m sure you’ll quickly find what to do with Jenkins on your Raspberry Pi ?
Additional Resources
Not sure where to start?
Understand everything about the Raspberry Pi, stop searching for help all the time, and finally enjoy completing your projects.
Watch the Raspberry Pi Bootcamp course now.
Master your Raspberry Pi in 30 days
Don’t want the basic stuff only? If you are looking for the best tips to become an expert on Raspberry Pi, this book is for you. Learn useful Linux skills and practice multiple projects with step-by-step guides.
Download the e-book.
VIP Community
If you just want to hang out with me and other Raspberry Pi fans, you can also join the community. I share exclusive tutorials and behind-the-scenes content there. Premium members can also visit the website without ads.
More details here.
Need help building something with Python?
Create, understand, and improve any Python script for your Raspberry Pi.
Learn the essentials step-by-step without losing time understanding useless concepts.
Get the e-book now.
You can also find all my recommendations for tools and hardware on this page.
How to Install Jenkins Server on Your Raspberry Pi
Installing Jenkins on your Raspberry Pi is a great way to get started with automation and continuous integration. Jenkins is an open-source automation server that can be used to automate tasks such as building, testing, and deploying software. It is a popular choice for DevOps teams because of its flexibility and scalability.
Prerequisites
- Raspberry Pi with Raspbian installed
- Internet connection
- SSH access to the Raspberry Pi
Step 1: Update the System
Before installing Jenkins, it is important to update the system. To do this, open a terminal window and run the following command:
sudo apt-get update && sudo apt-get upgrade
Step 2: Install Java
Jenkins requires Java to be installed on the Raspberry Pi. To install Java, run the following command:
sudo apt-get install openjdk-8-jdk
Step 3: Add the Jenkins Repository
Next, add the Jenkins repository to the Raspberry Pi. To do this, run the following command:
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
Then, add the repository to the sources list:
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
Step 4: Install Jenkins
Now that the repository is added, you can install Jenkins. To do this, run the following command:
sudo apt-get update && sudo apt-get install jenkins
Step 5: Start Jenkins
Once Jenkins is installed, you can start the server. To do this, run the following command:
sudo systemctl start jenkins
Step 6: Access the Jenkins Web Interface
Now that Jenkins is running, you can access the web interface. To do this, open a web browser and go to the following URL:
http://[Raspberry Pi IP address]:8080
You should now see the Jenkins web interface. You can now start using Jenkins to automate tasks on your Raspberry Pi.