---
# System prepended metadata

title: Setup Jenkins

---

# Setup Jenkins
1. Pull jenkins docker image
    ```shell=
    docker pull jenkins/jenkins
    ```
2. To create the folders, jenkins_home, for docker container
    ```shell=
    mkdir jenkins_home
    ``` 
3. execute the run-jenkins.sh to setup container for using
    ```shell=
    ./run-jenkin.sh
    ```
4. copy initial password
    ```shell=
    cat jenkins_home/secrets/initialAdminPassword
    ```
5. paste it for initializing jenkins
6. installed needed package
Note.
```shell=
#!/bin/bash -e

HOME_PATH=/home/nol/nol-services/jenkins/jenkins_home
docker run -p 8080:8080 -p 50000:50000 \
        --name jenkins-service \
        --hostname jenkins-service \
        -v $HOME_PATH:/var/jenkins_home \
        jenkins/jenkins:lts
```