Installation of Jenkins

To install Jenkins using Docker, you can follow these steps:

  1. Install Docker: Ensure that Docker is installed on your system. You can download and install Docker from the official Docker website (https://www.docker.com/get-started).

  2. Pull the Jenkins Docker image: Open a terminal or command prompt and execute the following command to pull the Jenkins Docker image from Docker Hub:

    docker pull jenkins/jenkins

    This command will download the latest version of the Jenkins Docker image.

  3. Run the Jenkins container: Once the image is pulled, run the Jenkins container using the following command:

    docker run -d -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home --name jenkins jenkins/jenkins

    This command starts the Jenkins container in detached mode (-d) and maps port 8080 from the container to the host machine (-p 8080:8080). It also maps port 50000 for Jenkins agent communication (-p 50000:50000) and sets the container name as "jenkins" using the --name flag.

  4. Wait for Jenkins to start: It may take a few moments for the Jenkins container to start up. You can monitor the container's logs by running the following command:

    docker logs -f jenkins

    Wait until you see a log line indicating that Jenkins is up and running. You should see a message like: "Jenkins is fully up and running".

  5. Access Jenkins web interface: Once Jenkins is up and running, you can access the Jenkins web interface by opening a web browser and navigating to http://localhost:8080. This will take you to the Jenkins initial setup wizard.

  6. Unlock Jenkins: The first time you access Jenkins, you will be prompted to enter an initial admin password. Retrieve the password from the Jenkins container logs by running the following command:

    docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword

    Copy the password and paste it into the Jenkins web interface to unlock Jenkins.

  7. Follow the Jenkins setup wizard: Proceed through the Jenkins setup wizard to customize your installation. You can install recommended plugins or choose specific plugins based on your requirements. Follow the instructions to create an admin user and complete the setup.

  8. Start using Jenkins: Once the setup is complete, you can start using Jenkins for your CI/CD workflows. You can create jobs, configure pipelines, and integrate with your version control system and other tools.

By following these steps, you can install Jenkins using Docker and access the Jenkins web interface to begin configuring and using Jenkins for your continuous integration and deployment needs.

Last updated