In this blog , We will explore how can we install Jenkins using docker .
Step -1 Run below command to pull jenkins image from docker hub repository.
docker pull jenkins/jenkins
![](https://i1.wp.com/asifwaquar.com/wp-content/uploads/2022/09/Screenshot-2022-09-21-at-12.59.50-AM.png?fit=688%2C381&ssl=1)
Step-2 Run the jenkins image in docker container with name jenkins-master and map to port 8080
docker run -p 8080:8080 --name=jenkins-master -d jenkins/jenkins
![](https://i2.wp.com/asifwaquar.com/wp-content/uploads/2022/09/Screenshot-2022-09-21-at-1.00.44-AM.png?fit=688%2C232&ssl=1)
Step-3 – By default Jenkins stores data into /var/jenkins_home . By mapping the volume of Jenkins directory (/var/jenkins_home) to home data directory inside container.
docker run -p 8080:8080 -v /Users/asif/jenkins-data:/var/jenkins_home -d jenkins/jenkins
![](https://i0.wp.com/asifwaquar.com/wp-content/uploads/2022/09/Screenshot-2022-09-21-at-2.19.58-AM.png?fit=688%2C131&ssl=1)
Step-4 -Execute below command to find Administrator password for Jenkins.
docker logs containerId
In my case my container id starting from e772 .So I have replace my containerid below and use password marked with red colour below.
docker logs e772
![](https://i1.wp.com/asifwaquar.com/wp-content/uploads/2022/09/Screenshot-2022-09-21-at-1.25.47-AM.png?fit=688%2C617&ssl=1)
Step-5 You will see below screen to install plugins to build/run pipelines. You can choose custom plugins or install suggested plugins.
![](https://i1.wp.com/asifwaquar.com/wp-content/uploads/2022/09/image.png?fit=688%2C392&ssl=1)
![](https://i2.wp.com/asifwaquar.com/wp-content/uploads/2022/09/image-3.png?fit=688%2C546&ssl=1)
Step-6 Create first admin user.
![](https://i1.wp.com/asifwaquar.com/wp-content/uploads/2022/09/image-1.png?fit=688%2C560&ssl=1)
Step-7 – After creating user you should be able to login and create pipelines.
![](https://i2.wp.com/asifwaquar.com/wp-content/uploads/2022/09/image-2.png?fit=688%2C288&ssl=1)