There are various methods available to install Jenkins for practicing, but using Docker is highly recommended as it allows you to run multiple containers on your local machine.
To get started with Docker, follow the below steps:
-
Install Docker on your machine.
-
Run the following command to start the Jenkins server:
docker run -p 8080:8080 jenkins/jenkins
Once the installation is complete, you can access Jenkins through localhost:8080.
- For the first time, Jenkins will ask you to change the password, as shown below:
- Open the command prompt and enter the Docker using the following command:
docker exec -it <container_name> bash
- Upon logging in, use the following command to get the password:
cat /var/jenkins_home/secrets/initialAdminPassword
Copy the password and paste it in the Jenkins portal.
- Install the suggested plugins as shown below:
-
Wait until all the plugins are installed.
-
Fill in all the details for username, password.
-
Keep the Jenkins URL as it is.
-
Now, you should be able to see the Jenkins home page.