the fast, reliable localhost tunneling solution

Installing pagekite as a launchctl service

2011-04-30, 17:12

The goal here is to have an OSX pagekite backend run automatically when the system starts up. Inspired by the DebianPackage, these instruction put in /usr/bin and the config file at /etc/pagekite/pagekite.rc.


Download You'll need to change the permissions to make it system runnable, and then put it in /usr/bin.

 wget --no-check-certificate
 chmod +x
 sudo chown root:wheel
 mv /usr/bin/

Download a sample pagekite.rc config file, or configure one however you like - nothing special should need to be changed for OSX.

  mkdir /etc/pagekite/
  mv .pagekite.rc /etc/pagekite/pagekite.rc

Now add as a launchctl service, pointing it to the options file:

 sudo launchctl submit -l pagekite -- --clean -o /etc/pagekite/pagekite.rc

Starting and Stopping

Now that it's installed with launchctl, should start whenever the system boots up, and even if crashes it should be restarted. These commands may be helpful:

sudo launchctl start pagekite
sudo launchctl stop pagekite
sudo launchctl remove pagekite

[ Back to How-Tos ]


  1. Jon said on 2011-11-02, 19:09
    There's a typo in this line:

    sudo launchtl submit -l pagekite -- --clean -o /etc/pagekite/pagekite.rc

    Should be:

    sudo launchctl submit -l pagekite -- --clean -o /etc/pagekite/pagekite.rc
  2. Laurent said on 2012-06-23, 01:05
    Hello !

    I tried to install pagekite as a service, the service works after executing the above command "sudo launchctl submit -l pagekite -- --clean -o /etc/pagekite/pagekite.rc" but doesn't restart after a reboot.

    Do you have an idea of what I am missing ?

  3. Bjarni RĂșnar Einarsson said on 2012-06-23, 13:13
    Just a guess, but perhaps you need to give the full path to in the launchctl command?
  4. OderWat (ADN/Twitter @OderWat) said on 2013-09-27, 13:47
    This wiki entry is not very useful!

    launchctl with argument "submit" is not creating anything which survives a reboot.

    "submit" by default also will use the keep alive functionality. So the mentioned "launchctl stop" will in effect not stop the demon but kinda restart it as launchd will restart the process if it is being stopped.

    To stop the daemon you need to use "remove" but this will not left anything over to "start" it again.

    To really create a daemon which survives a reboot you have to create a plist file in /Library/LaunchDaemons which will add this daemon to the global daemons which are run at boot time by launchd.

    Meanwhile I am working on a Blog entry with the detailed instructions. You may consider updating the wiki to something more useful!
  5. Micah Geisel said on 2015-11-21, 00:21
    Confirmed. Launchctl instructions didn't create the service correctly. Instead, I needed to create a file at /Library/LaunchDaemons/pagekite.service.plist with the following contents:

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




    Then, to install the service, run:

    sudo launchctl load /Library/LaunchDaemons/pagekite.service.plist

Leave a comment

( (Please leave these blank: )

We use Gravatar for commenter's photos. Get your own, it's free!