1.1 Install pre-requisites and Jenkins service
To install Jenkins, you need to install Java as the 1st requirement.
Below is the script to install the prerequisites for the server running SUSE Linux Enterprise Server. After you have received the handover from the server team, access to server by SSH (via Putty application) and run the script below.
Note: If you can start from the 1st step in the script below, you might need help from the local service team to install the rest (from step 1 to 5) from their side. After that, you can continue from section 1.2.
#jenkins-install.sh
#1.Update system
sudo zypper up
#2.Install java
sudo zypper install -y java-21-openjdk java-21-openjdk-devel
#3.Add repo Jenkins
sudo zypper addrepo -f http://pkg.jenkins.io/opensuse-stable/ jenkins
#4.Install Jenkins
sudo zypper install -y jenkins
#5.Enable Jenkins service
sudo systemctl enable jenkins
sudo systemctl start jenkins
sudo systemctl status jenkins
#6.Checking the port 8080 open in server (Local Address:Port)
sudo ss -tlpun
Note: If you get the error related to Permission denied, you can check the picture in the Troubleshooting section.
1.2. Configuration for Jenkins
Access to the Jenkins Server via IP address is available with the default port, 8080.
Example: http://Server-IP-address:8080/
Then enter the Administrator password value from this path: /var/lib/jenkins/secrets/initialAdminPassword
By using the code below:
cat /var/lib/jenkins/secrets/initialAdminPassword
Select Install suggested plugins
Wait until the plugin installation is completed
Create 1st Admin user
Start using Jenkins
Enter the public IP address or domain name of the server (including port 8080)
Home screen of Jenkins
1.3 Change Jenkins's working folder
To change the current working folder from /var/lib/jenkins to /opt/devops/jenkins,
do the following steps:
Change working folder steps
#1. Stop Jenkins service
sudo systemctl stop jenkins
#2. Create the new directory
sudo mkdir -p /opt/devops/jenkins
#3. Grant permission for jenkins user to new folder
sudo chown -R jenkins:jenkins /opt/devops/jenkins
#4. Copy existing Jenkins data (included jobs, plugins,...)
sudo rsync -avzh /var/lib/jenkins/ /opt/devops/jenkins/
#5. Update Jenkins configuration
sudo nano /etc/sysconfig/jenkins
##5.1 Find JENKINS_HOME="/var/lib/jenkins" -> Change to JENKINS_HOME="/opt/devops/jenkins"
##5.2 Find WorkingDirectory=/var/lib/jenkins -> WorkingDirectory=/opt/devops/jenkins (Optional if available)
##5.3 If the steps 5.1 does not work, you should also edit file usr/lib/systemd/system/jenkins.service and replace 2 parameters as steps 5.1 and 5.2 in that file.
#6. Reload systemd:
sudo systemctl daemon-reload
#7. Start Jenkins again
sudo systemctl start jenkins
#8. Verify new home directory
ps aux | grep jenkins
The expectation can be checked by the step No. 8 above.
or inside Jenkins UI → Manage Jenkins → System Information → Environment Variables → JENKINS_HOME
Cross-check the existing job already there in the new folders:
ls /opt/devops/jenkins/jobs
Troubleshooting
While installing the pre-requisite or Jenkins, if you face the problems below:
or
Solution: contact the local service team, who provided the access to your ADM account or your Infodba account.












Top comments (0)