Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Installing Jenkins with Docker
Development ToolsDevOps

Installing Jenkins with Docker

Easily deploy Jenkins with Docker for a fast and isolated CI/CD environment.

Eugene Obiedkov

by Eugene Obiedkov

Full Stack Developer

Aug, 2025
3 min read

facebooklinkedintwitter
copy
Installing Jenkins with Docker

Jenkins is one of the most popular automation tools for building, testing, and deploying applications. It plays a key role in DevOps practices and CI/CD pipelines, helping teams release updates faster while maintaining code quality.

In this guide, we’ll walk through setting up Jenkins LTS (Long-Term Support) using Docker. Running Jenkins in Docker makes the setup process much simpler, as it provides an isolated environment without manual server configuration.

👉 If you don’t already have Docker installed, follow this official installation guide before continuing.

Run Jenkins in a Docker Container

First, pull the latest Jenkins LTS image from Docker Hub. Open your terminal and run:

docker pull jenkins/jenkins:lts

Now, start a Jenkins container:

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

What the flags mean:

  • -d — runs the container in detached mode (background).
  • -p 8080:8080 — maps Jenkins to port 8080 (web access);
  • -p 50000:50000 — port for connecting Jenkins agents;
  • -v jenkins_home:/var/jenkins_home — creates a persistent volume for Jenkins data, so your configuration won’t be lost when the container restarts.

Once the container is running, open:

http://localhost:8080

When Jenkins first starts, it requires an admin password. To retrieve it, run:

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

Copy the password and paste it into the Jenkins setup screen.

carousel-imgcarousel-img

Jenkins will now prompt you to install plugins. Select Install Suggested Plugins to get the recommended set.

Next, set up your admin account by filling out the form with:

  • Username;
  • Password;
  • Full name;
  • Email.

Jenkins will suggest a default URL, usually http://localhost:8080/.

Leave it as is and click Save and Finish.

That’s it! Jenkins is now ready to use.

Conclusion

We successfully deployed Jenkins inside a Docker container. This setup provides several benefits:

  • Fast and isolated CI/CD environment setup;
  • Persistent data storage with Docker volumes;
  • Easy updates and portability.

From here, you can start creating pipelines, adding agents, and integrating Jenkins with your version control system.

Start Learning Coding today and boost your Career Potential

Start Learning Coding today and boost your Career Potential

Este artigo foi útil?

Compartilhar:

facebooklinkedintwitter
copy

Este artigo foi útil?

Compartilhar:

facebooklinkedintwitter
copy

Conteúdo deste artigo

Siga-nos

trustpilot logo

Endereço

codefinity
Sentimos muito que algo saiu errado. O que aconteceu?
some-alt