0
0
Jenkinsdevops~5 mins

Initial admin setup wizard in Jenkins - Commands & Configuration

Choose your learning style9 modes available
Introduction
When you install Jenkins for the first time, it needs some basic setup to secure and configure the system. The initial admin setup wizard helps you create the first admin user and install recommended plugins to get started quickly.
Right after installing Jenkins on a new server or machine.
When you want to secure Jenkins by creating an admin user before opening it to others.
When you want to quickly install essential plugins recommended by Jenkins.
When you need to configure basic settings like system URL and security options.
When setting up Jenkins for the first time to prepare it for your projects.
Commands
This command shows the initial admin password Jenkins generates during installation. You need this password to unlock Jenkins in the setup wizard.
Terminal
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Expected OutputExpected
5f3d2a1b4c6e7f8d9a0b1c2d3e4f5678
This command starts the Jenkins service so you can access the setup wizard through the web browser.
Terminal
sudo systemctl start jenkins
Expected OutputExpected
No output (command runs silently)
This command checks if Jenkins is running and listening on port 8080 by requesting the HTTP headers.
Terminal
curl -I http://localhost:8080
Expected OutputExpected
HTTP/1.1 200 OK Content-Type: text/html;charset=UTF-8 Content-Length: 1234 Date: Tue, 20 Jun 2024 12:00:00 GMT
-I - Fetch only HTTP headers to verify service availability
Key Concept

If you remember nothing else from this pattern, remember: the initial admin setup wizard secures Jenkins by creating the first admin user and installing essential plugins.

Common Mistakes
Trying to access Jenkins before starting the service.
Jenkins won't respond because the service is not running yet.
Always start Jenkins with 'sudo systemctl start jenkins' before accessing the setup wizard.
Not using the initial admin password from the secrets file.
You cannot unlock Jenkins without this password, so setup cannot continue.
Use 'sudo cat /var/lib/jenkins/secrets/initialAdminPassword' to get the password and enter it in the wizard.
Skipping plugin installation during setup.
Jenkins may lack important features needed for your projects.
Choose to install the recommended plugins during the wizard for a smooth start.
Summary
Use the initial admin password from the Jenkins secrets file to unlock the setup wizard.
Start the Jenkins service before accessing the web interface.
Install recommended plugins during the wizard to get essential features.