Jenkins 2.0: Turn off Setup wizard

9,645 views
Skip to first unread message

Curt Bushko

unread,
Mar 31, 2016, 4:44:46 PM3/31/16
to Jenkins Users
Hello,

I am building a Docker container based on jenkinsci/jenkins:2.0-beta-1. I am autofilling it in with jobs/pipelines but the annoying thing is that every time I run the image I have to go through the setup wizard.

How do disable this wizard so that my container will just be up and running?

Thanks!

Baptiste Mathus

unread,
Mar 31, 2016, 5:10:38 PM3/31/16
to jenkins...@googlegroups.com
There's a sysprop for that, but normally only for development mode.
But, NOT FOR KIDS, you can confuse things by forcing it to dev mode.

Probably reasonable for continuously starting from scratch from the docker container only, not for prod use obviously (beware that you may trigger weird behaviours w/ plugins that would use this property to change things for dev).

$ docker run -p 8080:8080 --env JAVA_OPTS="-Dhudson.Main.development=true -Djenkins.install.runSetupWizard=false" jenkinsci/jenkins:2.0-beta-1

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/149f107d-59d6-4f74-95bc-1b07742f8239%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Richard Bywater

unread,
Mar 31, 2016, 5:29:24 PM3/31/16
to jenkins...@googlegroups.com
It sounds to me like there's a good use-case for being able to skip the setup wizard even in "prod" mode? Is the jenkins.install.runSetupWizard ignored if development = false? If so would it make sense just to skip that check?

Richard.

R. Tyler Croy

unread,
Mar 31, 2016, 8:20:37 PM3/31/16
to jenkins...@googlegroups.com
(replies inline)

On Thu, 31 Mar 2016, Richard Bywater wrote:

> It sounds to me like there's a good use-case for being able to skip the
> setup wizard even in "prod" mode? Is the jenkins.install.runSetupWizard
> ignored if development = false? If so would it make sense just to skip that
> check?


I agree, for stuff like puppet-jenkins the provisioning of the Jenkins master
doesn't require the Getting Started wizard.



If the system property that Baptiste referenced isn't fully turning the wizard
off, then we need to fix that before RCs IMHO.



> On Fri, 1 Apr 2016 at 10:10 Baptiste Mathus <m...@batmat.net> wrote:
>
> > There's a sysprop for that, but normally only for development mode.
> > But, NOT FOR KIDS, you can confuse things by forcing it to dev mode.
> >
> > Probably reasonable for continuously starting from scratch from the docker
> > container only, not for prod use obviously (beware that you may trigger
> > weird behaviours w/ plugins that would use this property to change things
> > for dev).
> >
> > $ docker run -p 8080:8080 --env JAVA_OPTS="-Dhudson.Main.development=true
> > -Djenkins.install.runSetupWizard=false" jenkinsci/jenkins:2.0-beta-1
> >
> > 2016-03-31 22:44 GMT+02:00 Curt Bushko <cbu...@gmail.com>:
> >
> >> Hello,
> >>
> >> I am building a Docker container based on jenkinsci/jenkins:2.0-beta-1. I
> >> am autofilling it in with jobs/pipelines but the annoying thing is that
> >> every time I run the image I have to go through the setup wizard.
> >>
> >> How do disable this wizard so that my container will just be up and
> >> running?
> >>
> >> Thanks!
> >>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Jenkins Users" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an
> >> email to jenkinsci-use...@googlegroups.com.
> >> To view this discussion on the web visit
> >> https://groups.google.com/d/msgid/jenkinsci-users/149f107d-59d6-4f74-95bc-1b07742f8239%40googlegroups.com
> >> <https://groups.google.com/d/msgid/jenkinsci-users/149f107d-59d6-4f74-95bc-1b07742f8239%40googlegroups.com?utm_medium=email&utm_source=footer>
> >> .
> >> For more options, visit https://groups.google.com/d/optout.
> >>
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Jenkins Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to jenkinsci-use...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS53SUUKuoT4qem%3Dj6sgNJ_X3XjXnOmFrE5-JZzyCjAU-Q%40mail.gmail.com
> > <https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS53SUUKuoT4qem%3Dj6sgNJ_X3XjXnOmFrE5-JZzyCjAU-Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> > .
> > For more options, visit https://groups.google.com/d/optout.
> >
>
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAMui947kKui-ATTvXoNh7oaAAv0arvKiMxJ8ENL2xSiqbk6SoQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

- R. Tyler Croy

------------------------------------------------------
Code: <https://github.com/rtyler>
Chatter: <https://twitter.com/agentdero>

% gpg --keyserver keys.gnupg.net --recv-key 3F51E16F
------------------------------------------------------
signature.asc

Stuart Warren

unread,
Apr 5, 2016, 10:55:00 AM4/5/16
to Jenkins Users


On Friday, 1 April 2016 01:20:37 UTC+1, R Tyler Croy wrote:
(replies inline)

On Thu, 31 Mar 2016, Richard Bywater wrote:

> It sounds to me like there's a good use-case for being able to skip the
> setup wizard even in "prod" mode? Is the jenkins.install.runSetupWizard
> ignored if development = false? If so would it make sense just to skip that
> check?


I agree, for stuff like puppet-jenkins the provisioning of the Jenkins master
doesn't require the Getting Started wizard.



If the system property that Baptiste referenced isn't fully turning the wizard
off, then we need to fix that before RCs IMHO.


I'm currently testing this groovy script /usr/share/jenkins/ref/init.groovy.d/set-install-state.groovy to hack around this limitation:

```
import jenkins.model.*;
import hudson.util.*;
import jenkins.install.*;

j = Jenkins.getInstance()
uw = j.getInjector().getInstance(UpgradeWizard.class)
uw.setCurrentLevel(new VersionNumber("2.0"))
j.setInstallState(InstallState.INITIAL_SETUP_COMPLETED)
```

Today is the first time I've tried groovy though, so probably doing something silly.
Are there any obvious improvements to the above?

Daniel Beck

unread,
Apr 5, 2016, 12:09:30 PM4/5/16
to jenkins...@googlegroups.com

On 05.04.2016, at 16:54, Stuart Warren <stuartw...@gmail.com> wrote:

> Today is the first time I've tried groovy though, so probably doing something silly.
> Are there any obvious improvements to the above?

You could alternatively just go with patching the JENKINS_HOME so Jenkins considers it not an update:

$ echo -n 2.0 > $JENKINS_HOME/upgraded
$ echo -n 2.0 > $JENKINS_HOME/.last_exec_version

The files are being renamed in https://github.com/jenkinsci/jenkins/pull/2215, but for beta 2, the above appears to work.

But please note that this is considered internal storage so may not work this way forever. I think we'll pretty quickly introduce a supported alternative way though.

Scott Cutler

unread,
Apr 21, 2016, 2:20:24 PM4/21/16
to Jenkins Users, m...@beckweb.net
Any updates on this? I am also deploying Jenkins as part of a Vagrant script that automatically downloads and deploys Jenkins to Tomcat, then immediately begins running jobs via the CLI. When my vagrant script downloaded the 2.0 release this morning, the new setup wizard essentially blocked the install script. It would be helpful to have a documented procedure on the Jenkins site to disable the setup wizard and provide the previous "it-just-works-without-authentication" functionality, provided the user has root shell access and can edit XMLs or provide JDK arguments.

Stuart Warren

unread,
Apr 22, 2016, 6:21:49 AM4/22/16
to jenkins...@googlegroups.com, m...@beckweb.net
Currently I'm creating 2 files:

/var/lib/jenkins/jenkins.install.UpgradeWizard.state
```
2.0
```

/var/lib/jenkins/init.groovy.d/basic-security.groovy
```
#!groovy

import jenkins.model.*
import hudson.security.*

def instance = Jenkins.getInstance()

println "--> creating local user 'admin'"

def hudsonRealm = new HudsonPrivateSecurityRealm(false)
hudsonRealm.createAccount('admin','admin')
instance.setSecurityRealm(hudsonRealm)

def strategy = new FullControlOnceLoggedInAuthorizationStrategy()
instance.setAuthorizationStrategy(strategy)
instance.save()
```

Which seems to do enough.

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/Pb4QZVc2-f0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/09d68a96-72a6-424f-a3aa-cf11e6bacf5c%40googlegroups.com.

Mike Albert

unread,
May 2, 2016, 4:47:26 PM5/2/16
to Jenkins Users, m...@beckweb.net
Anybody else have a workaround for this?  I tried adding jenkins.install.UpgradeWizard.state and the groovy script to my install, but I'm still being prompted to unlock jenkins after the install.  Version of my Jenkins install is below:

Stuart Warren

unread,
May 2, 2016, 5:17:22 PM5/2/16
to jenkins...@googlegroups.com, m...@beckweb.net
Can you confirm that Jenkins is starting up or is restarted after those files are in place?

Daniel Beck

unread,
May 2, 2016, 6:13:08 PM5/2/16
to jenkins...@googlegroups.com

> On 02.05.2016, at 22:47, Mike Albert <mike....@cru.org> wrote:
>
> Anybody else have a workaround for this?

See my answer from April 21.

Richard Bywater

unread,
May 2, 2016, 6:15:19 PM5/2/16
to jenkins...@googlegroups.com
@Daniel - FYI I can't actually see a reply from you in this thread from April 21st. 6th April seems to be the last email from you in the thread.

Richard.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/28A33958-3D13-436A-BFD1-54020CA72B31%40beckweb.net.

Daniel Beck

unread,
May 2, 2016, 6:44:18 PM5/2/16
to jenkins...@googlegroups.com

> On 03.05.2016, at 00:15, Richard Bywater <ric...@byh2o.com> wrote:
>
> @Daniel - FYI I can't actually see a reply from you in this thread from April 21st. 6th April seems to be the last email from you in the thread.

I hate my email client :-(

Set the system property jenkins.install.runSetupWizard to false to skip both install and upgrade wizards -- this will not enable security options either:

java -Djenkins.install.runSetupWizard=false -jar jenkins.war

https://wiki.jenkins-ci.org/display/JENKINS/Features+controlled+by+system+properties

Mike Albert

unread,
May 3, 2016, 11:44:13 AM5/3/16
to Jenkins Users
Adding a restart step to our Jenkins deployment script did the trick.  The java option to disable the setup wizard is working as well.  Thanks!

Mike Albert

unread,
Oct 26, 2016, 11:56:29 AM10/26/16
to Jenkins Users
Setting Djenkins.install.runSetupWizard=false doesn't seem to be working correctly for me with more recent Jenkins releases.  Setting that flag for Jenkins 2.1 works fine, but that same flag doesn't work with the latest release (2.27) or stable release (2.7.4).  Is there a different flag that I should be setting?

Mike Albert

unread,
Nov 1, 2016, 4:12:00 PM11/1/16
to Jenkins Users
Found a solution for this issue.  In previous releases, I had set this flag via JENKINS_JAVA_OPTIONS in /etc/default/jenkins.  If I move that same flag from JENKINS_JAVA_OPTIONS to JAVA_ARGS in /etc/default/jenkins, it works as expected.
Reply all
Reply to author
Forward
0 new messages