Skip to main content
The official Jenkins image is available on Docker Hub.
1
Create docker-compose.yml
2
version: '3.8'
services:
  jenkins:
    image: jenkins/jenkins:jdk11
    restart: always
    privileged: true
    user: root
    ports:
      - '8081:8080'
      - '50000:5000'
    container_name: jenkins_jdk11
    volumes:
      - ~/Desktop/self-hosted/jenkins_home:/var/jenkins_home
      - /var/run/docker.sock:/var/run/docker.sock
3
You can map /var/jenkins_home to any local path you prefer. The path shown (~/Desktop/self-hosted/jenkins_home) is just an example.
4
Start Jenkins in the Background
5
docker-compose up -d
6
Verify the Container is Running
7
docker-compose ps
8
Retrieve the Initial Admin Password
9
docker exec jenkins_jdk11 cat /var/jenkins_home/secrets/initialAdminPassword
10
Open Jenkins in Your Browser
11
Navigate to http://localhost:8081 and paste the admin password retrieved in the previous step to complete the setup wizard.

Build docs developers (and LLMs) love