Due to some maintenance issues, this service has been switched in read-only mode, you can find more information about the why

and how to migrate your plugin documentation in this blogpost

Skip to end of metadata
Go to start of metadata

You should have Docker properly installed on your machine. Check Docker installation guide for details.

First, pull the official jenkins image from Docker repository.

docker pull jenkins

Next, run a container using this image and map data directory from the container to the host; e.g in the example below /var/jenkins_home from the container is mapped to jenkins/ directory from the current path on the host. Jenkins 8080 port is also exposed to the host as 49001.

docker run -d -p 49001:8080 -v $PWD/jenkins:/var/jenkins_home:z -t jenkins/jenkins

Addtionally, you can configure nginx as a reverse proxy to your Jenkins instance, e.g.

upstream app {
server {
    listen 80;
    server_name jenkins.your-domain.com;

    location / {
        proxy_pass http://app;
  • No labels


  1. Unknown User (sravanb)

    I was able to pull image successfully and while I run the image the volume link was working fine too, but the container is dying after some seconds. So I was unable to see jenkins up & running. Any ideas? Thank you!

    1. Unknown User (ralphbean)

      Try adding `:z` at the end of the mount like this:$ docker run -d -p 49001:8080 -v $PWD/jenkins:/var/jenkins_home:z -t jenkins

      That sets the selinux context, which may be incorrect.

  2. Unknown User (eranmark)

    How can I set it for persistance, in case docker service is restarted?

    1. Unknown User (lmcdasm)

      add --restart=always to the command line


  3. Unknown User (yogen_prasad)

    Hi Markus,

    For making the Jenkins Configuration persistant , you can just use Docker container volumes.

    In you Compose.yml :


    and under your Jenkins service add volune as :- jenkins_conf:/var/jenkins_home/



  4. Unknown User (lub121)

    How to update jenkins docker container?
    Jenkins in my docker version is Jenkins 2.60.3  and latest update is 2.73.3 ?

    1. Unknown User (jennbriden)

      To update your Jenkins instance, just rerun the initial command:

      docker pull jenkins

  5. Unknown User (naktinis)

    I ran all the commands as provided and I get an error running "docker run ...":

    touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied
    Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?

    My uid is 1001, but for some reason docker runs it as uid 1000, which is a different user.

    I'm running it on ubuntu and it's a pretty standard configuration, so I believe you should at least mention this in this documentation page. Or maybe even consider redesigning the installation procedure somehow.

    1. Unknown User (plamenti)

      Hi R Nak,

      This works for me:

      1. Prepare the volume directory:
        $ mkdir $PWD/jenkins
      2. The directory need to be separated with the admin ownership to keep the Jenkins home:
        $ chown 1000 $PWD/jenkins
      3. Now run the command from the example:
        docker run -d -p 49001:8080 -v $PWD/jenkins:/var/jenkins_home:z -t jenkins
    2. Unknown User (jennbriden)

      Also, make sure that Docker is configured to have access to the host volume where you are storing the files. For example, C:\. You can set this in the Docker UI and by CLI.


  6. Unknown User (jcamilli)

    Here's a script to start Jenkins ... 

    # Pull latest container
    docker pull jenkins
    # Setup local configuration folder
    # Should already be in a jenkins folder when running this script.
    export CONFIG_FOLDER=$PWD/config
    mkdir $CONFIG_FOLDER
    chown 1000 $CONFIG_FOLDER
    # Start container
    docker run --restart=always -d -p 49001:8080 \
    -v $CONFIG_FOLDER:/var/jenkins_home:z \
    # -e http_proxy='http://proxy.com:8080' \
    # -e https_proxy='http://proxy.com:8080' \
    --name jenkins -t jenkins
    docker logs --follow jenkins