Storing Passwords in Jenkins—Here’s How I Keep Them Safe and Sound!
From best practices to hands on tips, here’s a simple guide to securely managing passwords in Jenkins.

First, create a Personal Access Token. How do you create a PAT?
- Follow These Steps:
Log in to DockerHub: https://hub.docker.com/
Go to Account settings:

- Click on Generate New Token:

- Add the following details:

Once you click on Generate, you will see your Docker username and password details encrypted.
Note: We use this method because it is a safe way to log in. Otherwise, you could use the
docker login -u 'username' -p 'password'command, but it is not recommended due to security concerns.Go to Jenkins Dashboard → Manage Jenkins → Security → Credentials → (global) [Add cred in (global) domain]

- Click on Add Credentials:

- Add required details:

This is how you can store passwords in Jenkins.
Now you can access your image in any docker repository.

- You can also store GitHub credentials in Jenkins in a similar way to DockerHub, allowing you to access any private repository.
I hope you understand the concept of storing password in Jenkins.
Happy Learning! :)
About the author
- DevOps Engineer focused on automating workflows, optimizing infrastructure, and building scalable efficient solutions.
Comments
Join the discussionNo comments yet. Be the first to comment.




