Initial Setup Wizard
On first launch Jenkins asks for an unlock password, installs plugins, and creates your admin user.
The first time you open Jenkins at http://localhost:8080, a setup wizard walks you through securing and configuring it.
Step 1: Unlock Jenkins
For security, Jenkins generates a random initial admin password and writes it to a file inside the Jenkins home directory. You paste it in to prove you own the server.
Step 2: Install plugins
Choose Install suggested plugins for a sensible default set (Git, Pipeline, etc.), or pick your own.
Step 3: Create admin user
Create your first administrator account with a username and password. From now on you log in with this instead of the setup password.
Step 4: Instance URL
Confirm the URL where Jenkins is reachable. This is used in links and webhook callbacks.
Example
# Reveal the initial admin password
# On a normal install:
cat /var/jenkins_home/secrets/initialAdminPassword
# When running in Docker:
docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPasswordWhen to use it
- An engineer retrieves the initial admin password from Docker logs to unlock Jenkins on a brand-new container.
- A team lead skips suggested plugins during setup and manually installs only the plugins their pipeline needs.
- A sysadmin records the admin password from the log during first boot so the team can log in immediately.
More examples
Read unlock password from container
Extracts the auto-generated unlock password from inside the running Jenkins Docker container.
docker exec jenkins \
cat /var/jenkins_home/secrets/initialAdminPasswordFind password in Docker logs
Greps the initial admin password directly from Jenkins container startup log output.
docker logs jenkins 2>&1 \
| grep -A 2 'initial admin password'Automate admin creation via init script
Uses the Jenkins init.groovy.d hook to programmatically create an admin account during first boot.
// /var/jenkins_home/init.groovy.d/create-admin.groovy
import jenkins.model.*
import hudson.security.*
def instance = Jenkins.get()
def realm = new HudsonPrivateSecurityRealm(false)
realm.createAccount('admin', 'MySecurePass!')
instance.setSecurityRealm(realm)
instance.save()
Discussion