To install Jenkins on Rocky Linux, you need to add the Jenkins package repository to your server’s package sources. You can do this by running the following command:
wget -q -O - <https://pkg.jenkins.io/debian/jenkins.io.key> | sudo rpm --import -
echo "[jenkins]
name=Jenkins
baseurl=https://pkg.jenkins.io/redhat
gpgcheck=1
gpgkey=https://pkg.jenkins.io/redhat/jenkins.io.key
enabled=1" | sudo tee /etc/yum.repos.d/jenkins.repo
This will add the Jenkins package repository to your server, and download the Jenkins package signing key.
Next, you need to update the package list and install Jenkins by running the following commands:
sudo yum update
sudo yum install jenkins
This will update the package list and install the latest version of Jenkins, along with the necessary dependencies.
Once Jenkins is installed, you need to start the Jenkins service and enable it to start automatically on system boot by running the following commands:
sudo systemctl start jenkins
sudo systemctl enable jenkins
These commands will start the Jenkins service and enable it to start automatically whenever the server is restarted.
Now that Jenkins is installed and running, you need to set up the initial administrator password. To do this, you need to check the location of the initial administrator password in the Jenkins log file. You can do this by running the following command:
sudo cat /var/log/jenkins/jenkins.log
This will print the Jenkins log file to the terminal, and you should see a line that looks like this:
Please use the following password to proceed to installation: abcdefghijklmnopqrstuvwxyz012345
This line contains the initial administrator password, which you will use to log in to Jenkins for the first time.
Once you have the initial administrator password, you can log in to Jenkins by visiting the http://your_server_ip_or_hostname:8080
URL in your web browser. This will open the Jenkins login page, where you can enter the initial administrator password and click the “Sign in” button to log in to Jenkins.
Once you are logged in, you will see the Jenkins dashboard, which is the main interface for managing your Jenkins instance. From here, you can create new jobs, view the status of existing jobs, and configure the settings for your Jenkins instance. You can also install additional plugins to extend the functionality of Jenkins.
To install plugins in Jenkins, you need to click on the “Manage Jenkins” link in the left-hand menu, and then click on the “Manage Plugins” link. This will open the “Manage Plugins” page, where you can search for and install plugins. You can also click on the “Available” tab to see a list of all available plugins, and select the plugins that you want to install.
Once you have installed the plugins that you need, you can start creating jobs in Jenkins. To create a new job, click on the “New Item” link in the left-hand menu, and enter a name for your job. Then, select the “Freestyle project” option, and click the “OK” button. This will open the job configuration page, where you can specify the details for your job, such as the source code repository, the build script, and the build triggers.
In conclusion, installing Jenkins on Rocky Linux is a simple process that involves adding the Jenkins package repository, installing Jenkins, starting the Jenkins service, and setting up the initial administrator password. By following the steps outlined in this article, you can quickly and easily set up a Jenkins instance on your server and start automating your software development processes with Jenkins.