How to install Hudson as a service on OS X?

Running hudson it is easy but currently the documentation is missing the tutorial for installing an running hudson as a daemon/service on OS X.

When you switch to production you need to assure that it is properly configured and secured.

  • How to change Jenkins default folder on Windows?
  • buildbot vs hudson/jenkins for C++ continuous integration
  • Hudson git error ssh
  • Jenkins Subversion Error - E200015: No credential to try. Authentication failed
  • Hudson/Jenkins PMD Configuration
  • Prevent Jenkins from Installing Artifact to Local Maven Repository
  • Requirements:

    • be able to run it on port 80
    • not running as root (or at least not running the jobs as root)
    • assure that it does properly start/stop on system restarts
    • enable auto-upgrade, that works directly from the web interface.

    The best, would be to have an installation script that downloads latest hudson and installs it.

    We’ll integrate the best answer to Hudson wiki.



  • unable to run firefox through jenkins?
  • access denied when cloning local git from Jenkins
  • Configure Jenkins Mac OS X native package to run in a different port
  • Is there a way to keep Hudson / Jenkins configuration files in source control?
  • jenkins workflow “Build whenever a SNAPSHOT dependency is built”
  • Same workspace for multiple jobs
  • 3 Solutions collect form web for “How to install Hudson as a service on OS X?”

    If you want a local Hudson to run on your Mac whenever you log in, try this.

    You’ll want to set up a launchctl plist for it; that should look something like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
    <plist version="1.0">

    This assumes you’ve downloaded hudson.war to your home directory under ~/Hudson, and that you want to run it as yourself (probably the best decisions.) Be sure that you define the <UserName> key or it will run as root!

    Starting on login

    1. Save the above as /Library/LaunchAgents/hudson.plist
    2. Start it the first time with

      sudo launchctl load -w /Library/LaunchAgents/hudson.plist

    or log out and back in, which will do the same thing automatically.

    Starting on reboot

    1. Save the above as /Library/LaunchDaemons/hudson.plist
    2. Start it the first time with

      sudo launchctl load -w /Library/LaunchDaemons/hudson.plist

    or reboot your machine, which will do the same thing automatically.

    Restarting Hudson

    Hudson can’t automatically restart under OS X, so if you need to stop it, issue the restart command

    launchctl unload -w path_to_plist

    I have found that sometimes it doesn’t stop on the first execution of launchctl unload; in those cases just issue the command again.

    This will run under port 8080 as if you had run the command from the command line yourself, using the Winstone server built in to the .war file.

    I realize this doesn’t specifically answer the “run it on port 80” question, but for development on your own laptop, I suggest that this is a better option.

    The correct solution is to install hudson inside tomcat and make tomcat run as daemon

    This will also meet the security requirements and allow you to upgrade hudson with ease.

    Here is the full guide for OS X 10.6:

    The tiny solution I had (which also starts at login) was this:
    First run hudson manually once (so it builds it’s .hudson dir).
    create a hudson.command file somewhere on your machine in OSX with content a little like this:

    nohup java -jar .hudson/hudson.war --httpPort=8080 &

    Then, open up system preferences, select your user, and then Login Items. Click the “+” button, and you’ll be able to select the command with finder.

    Next time you log in, hudson will have started.


    • Hudson has no specific user – it’s just you
    • hudson is on port 8080
    • Hudson restarts mean finding the process, killing it and starting the hudson.command file again.
    • Hudson starts only once a user has logged in.
    Git Baby is a git and github fan, let's start git clone.