Download the jenkins installer from the below link.
Click on the Mac OS X to download.
The Jenkins installer for mac is downloaded.
For Jenkins, Java needs to be installed on the system, since Jenkins is written in Java. So check if Java is installed on the system by running the below command.
It should return java version information similar to below.
If java information is not returned, then java is not installed on the system, so install Java first before continuing to the next step.
Double click on the downloaded Jenkins installer to launch the installer.
Click on ‘Continue’ to start the installation process.
Click on ‘Continue’ to accept the license and continue to installation.
Click on ‘Agree’ to agree to license terms and continue installation.
The installer asks information regarding which users of the system do you want Jenkins to be installed for. You can leave the default provided and click on ‘Continue’.
You can change the jenkins installation location by clicking on ‘Change Install Location’, or you can leave the default installation location and click on ‘Install’ to start installing Jenkins.
Enter your mac user name and password to click on ‘Install Software’ to start Jenkins installation.
The installation will take some time to complete.
Click on ‘Close’ once the installation is complete.
Click on ‘Move to Trash’ if you want to delete the Jenkins installer downloaded and used for installation. If you don’t want to delete it, click on ‘Keep’.
The jenkins is installed at the below location.
The jenkins installation folder should look similar to below.
Once the jenkins installation is complete, it opens the below page on the web browser. You need to enter to temp admin password provided by Jenkins to start configuring the jenkins and creating the users on jenkins.
The location of the temp password file is provided in the same page below. It is supposed to be at ‘/Users/Shared/Jenkins/Home/secrets/initialAdminPassword’.
Navigate to that location, to open the password file. But as you can see in the below screen shot, there are no files in the secrets folder.
Actually the files are there, but we cant see them. You need to change permissions to view the files in the secrets folder. Follow the below steps to change the permissions.
Right click on the secrets folder and select ‘Get Info’ option.
Enter the mac system user name and password to open the information regarding the secrets folder.
The information regarding the secrets folder is displayed.
Click on the lock symbol at the bottom right side corner of the secrets info view.
Enter the mac system user name and password to continue to modify the secrets folder permissions.
The list of the available users and groups on the mac are displayed.
select the user name you used to log into mac and click on ‘Select’ button.
The user you selected is added to the ‘Sharing & Permissions’ section of the secrets info screen and it indicates that the user you selected has ready only permissions now. Now click on settings button in middle at the bottom of the secrets info view and select ‘Apply to enclosed items’ to save the modifications.
Click on ‘OK’ to save the modifications.
Now the files inside the secrets folder are displayed and you can see the initialAdminPassword file also inside the secrets folder. Open the initialAdminPassword file and copy the password inside it.
Paste the initial password into ‘Unlock Jenkins’ screen and click on ‘Continue’.
The jenkins installation is not able to connect to the plugin repository, but they can always be added/removed at any time, so click on ‘Skip Plugin Installations’ to continue configuring Jenkins.
You can create your first admin user for Jenkins.
Provide user name, name and password and click on ‘Save and Continue’ to create a admin user.
The jenkins url can be modified, if needed. This can be changed later if needed, so leave it as it is, and click on ‘Save and Finish’.
The jenkins installation and configuration is complete and ready for use. Click on ‘Start using Jenkins’.
The home view of the user you created is displayed.
To stop the jenkins service, run the below command in the terminal.
sudo launchctl unload /Library/LaunchDaemons/org.jenkins.ci.plist
To start the jenkins service, run the below command in the terminal.
sudo launchctl load /Library/LaunchDaemons/org.jenkins.ci.plist
You may need to enter the mac password to stop/start the jenkins after running the above stop/start commands.
Jenkins can be uninstalled running the below command in the terminal.
sudo /Library/Application\ Support/Jenkins/Uninstall.command
In this post, we have how to install, Configure, Restart and Uninstall Jenkins on Mac OS X. Once the Jenkins installation is complete, the projects creating builds, pipelines etc is same on all the environments, which we discuss in later posts.