Configuring Jupyter to automatically start in the background on OSX

We'll use launchd to take care of this. Create a property list file:

touch ~/Library/LaunchAgents/com.jupyter.server.plist

Paste the followinf configuration in the file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>KeepAlive</key>
    <true/>
    <key>Label</key>
    <string>org.jupyter.notebook</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/jupyter-notebook</string>
        <string>--no-browser</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>StandardErrorPath</key>
    <string>/Users/rickard/Library/LaunchAgents/org.jupyter.notebook.stderr</string>
    <key>StandardOutPath</key>
    <string>/Users/rickard/Library/LaunchAgents/org.jupyter.notebook.stdout</string>
    <key>KeepAlive</key>
    <true/>
    <key>WorkingDirectory</key>
    <string>/Users/rickard/jupyter</string>
</dict>
</plist>

Test that it works with

launchctl load com.jupyter.server.plist
launchctl start com.jupyter.server.plist

You should be able to navigate to localhost:8888 and see a list of available notebooks.