Where Jenkins stores your login credentials

Jenkins does not send you a username and password by email when you first set it up. Instead, the person who installed Jenkins on your server creates the first admin account during setup, and that account lives in a configuration file on the machine where Jenkins runs.

If you installed Jenkins yourself, you chose that username and password. If someone else set it up, they either told you the credentials at the time or you will need to reset them. Jenkins has no "forgot password" link — you reset credentials by editing files directly on the server or through the Jenkins command line interface.

Key Takeaways

  • The first Jenkins admin account is created during installation and stored in a configuration file, not in a database you can query remotely.
  • If you have SSH access to the server, you can reset the admin password by editing the config.xml file in the Jenkins home directory.
  • You can also disable security entirely in Jenkins and set up a new admin account from the web interface, then re-enable security afterward.
  • If Jenkins is running in a container or cloud environment, the setup method varies — check whether Jenkins is running on Docker, Kubernetes, or a managed service.
  • The Jenkins home directory is usually /var/lib/jenkins on Linux or C:\ProgramData\Jenkins on Windows, but the installer may have placed it elsewhere.

Resetting the password if you have server access

If you can log in to the server via SSH, you can reset the Jenkins admin password by stopping Jenkins, editing its configuration file, and restarting it. This is the fastest method and requires no special tools.

First, stop the Jenkins service. On Linux with systemd, run sudo systemctl stop jenkins. On other systems, the command depends on how Jenkins was installed — it might be sudo service jenkins stop or you may need to kill the process directly.

Next, navigate to the Jenkins home directory. On Linux this is usually /var/lib/jenkins. On Windows it is usually C:\ProgramData\Jenkins. Inside that directory, open the file config.xml in a text editor. Look for a section that contains <useSecurity>true</useSecurity>. Change true to false, save the file, and restart Jenkins with sudo systemctl start jenkins.

When Jenkins restarts, security will be disabled. Log in without a username or password. Go to Manage Jenkins (or Manage Jenkins > Security depending on your version), enable security again, and create a new admin account with a username and password you choose. Then restart Jenkins one more time to lock in the changes.

Finding the username if you only lost the password

If you know the username but forgot the password, you can reset just the password without disabling security entirely. This requires editing the Jenkins configuration files directly on the server.

Stop Jenkins and navigate to /var/lib/jenkins/users (or the equivalent on your system). Inside that directory you will see a folder for each user account. Open the folder that matches your username, then open the file config.xml inside it.

Look for a section containing <passwordHash>. Delete the entire line or replace it with a blank value. Save the file and restart Jenkins. When you log in, Jenkins will prompt you to set a new password on your first login.

Checking where Jenkins is actually installed

Jenkins can be installed in many ways — as a system service, inside Docker, on Kubernetes, or in a managed cloud environment. The location of the home directory and the method to reset credentials changes depending on how it was set up.

If Jenkins is running as a system service on Linux, check the systemd unit file at /etc/systemd/system/jenkins.service or /lib/systemd/system/jenkins.service. Look for a line that says Environment="JENKINS_HOME=..." — that tells you where the configuration files are stored.

If Jenkins is running in Docker, you will need to enter the container with docker exec -it [container-name] /bin/bash, then navigate to the home directory inside the container (usually /var/jenkins_home). If Jenkins is on a managed platform like CloudBees or AWS, check the platform's documentation — you may be able to reset credentials through the web dashboard instead of the command line.

Using the Jenkins CLI if you have a token

If you have an existing API token or SSH key pair set up for Jenkins, you can use the Jenkins command-line interface to change the password without editing files directly. This method works if you can authenticate as any user with admin permissions.

read the Jenkins CLI jar file from your Jenkins instance at http://your-jenkins-url/jnlpJars/jenkins-cli.jar. Then run a command like java -jar jenkins-cli.jar -s http://your-jenkins-url -auth username:token change-password-for-user username, replacing the URL, username, and token with your actual values.

This approach is less common for password resets because most people who have lost their password do not have a working token. It is more useful if you are automating password changes or managing multiple Jenkins instances.

What to do if you cannot access the server

If you do not have SSH access to the server and cannot log in to Jenkins, you will need to contact whoever manages the server. They can reset the password using the methods above, or they can provide you with the credentials if they have them documented.

If the server is in a cloud environment like AWS, Azure, or Google Cloud, check whether you have access to the cloud console. You may be able to connect to the instance through the cloud provider's web-based terminal, which gives you the same access as SSH. If Jenkins is running on a managed platform, contact the platform's support team — they may have a password reset feature built into their dashboard.

Preventing password loss in the future

Once you have regained access, store your Jenkins credentials in a password manager rather than writing them down or relying on memory. If you manage multiple Jenkins instances, document which server each one is on and who has access to reset credentials if needed.

Consider setting up Jenkins authentication through an external system like LDAP, Active Directory, or OAuth (GitHub, Google, etc.). This way, users log in with credentials they already know, and you do not have to manage Jenkins passwords separately. You can also create additional admin accounts so that password loss for one account does not lock everyone out.

Frequently Asked Questions

Can I reset the Jenkins password without restarting Jenkins?

No. Jenkins reads its configuration files when it starts up. To change the password or disable security, you must stop Jenkins, edit the files, and restart it. The restart usually takes less than a minute.

What if I do not know the Jenkins home directory?

Log in to the server and run ps aux | grep jenkins to see the Jenkins process. Look for a flag like -Djenkins.home=/path/to/home in the output. If that does not show it, check the systemd unit file or the Jenkins startup script for an environment variable that points to the home directory.

Will resetting the password delete my Jenkins jobs and configuration?

No. The password is stored separately from your jobs, pipelines, and build history. Resetting the password or disabling and re-enabling security does not affect any of that data.

Can I reset the password if Jenkins is running in Docker?

Yes. Use docker exec -it [container-name] /bin/bash to enter the container, then follow the same steps as you would on a regular Linux server. The home directory inside the container is usually /var/jenkins_home.

What if there is no admin account at all?

If Jenkins was installed but never had security enabled, you can log in without a username or password. Go to Manage Jenkins, enable security, and create an admin account. From that point forward, you will need to log in.