Raspberry Pi Remote Wake/Sleep-On-LAN Server


A Wake/Sleep-on-LAN Server Powered by a Pi!

A Wake/Sleep-on-LAN Server Powered by a Pi!

Note: This post and the accompanying software packages have been updated several times since this was originally posted. The most up-to-date releases and instructions can always be found in the GitHub Repo. Update notes are appended to the end of this blog post.

I have a very power hungry desktop computer that I use for video editing and large file storage. When I’m travelling with my laptop, I obviously can’t carry all my files and data with me, so I occasionally use “remote desktop” to access my desktop from the road. I also use a Plex Media Server to stream content from my desktop computer. However, the computer has to be on for me to be able to do this. This means I need to leave the computer on all the time, just in case I need to access it. This wastes power, costs me money, and harms the environment. My Raspberry Pi, on the other hand, consumes a minuscule amount of power, and is always on anyways, serving other purposes. In this tutorial, I’ll show you how to run a simple mobile-friendly website from your Raspberry Pi that will allow you to remotely wake up your power-hungry computer, so you can remotely access it. When you’re done, just put it back to sleep from within the remote desktop service (or use the mobile app plus a small background server running on your desktop to put it back to sleep – this is described in the instructions). The app pings the computer from the Raspberry Pi to inform you of when the computer has woken up and established network connectivity. Follow along after the break…

Once you’re done setting up your Pi-Powered Wake/Sleep on LAN Server, here’s how it will work…

  1. From wherever you are in the world, navigate to your unique, dynamically updating URL (
  2. You’ll be presented with a screen that looks like the one below (note, you may get a security popup first, if you choose to use a self-signed certificate to enable HTTPS – this is described in the instructions). From this screen, you can select which machine you want to control, and you can view its state (awake or asleep). You can add as many machines that you want to control. Here, you can see that “Phoenix Desktop” is currently awake, and I have the option to put it to sleep:
  3. Next, you’ll enter a passphrase that you’ve pre-chosen. If the wrong phrase is entered, a “denial” note will pop up, and you’ll be able to try again. If you enter the right phrase, the Raspberry Pi can send a “Wake Up” or “Sleep” command to the remote machine. It will then ping that computer and display the results in real-time, so that you know when the computer has finished booting or when it has finished going to sleep. Here, you can see what that screen looks like when I put “Phoenix Desktop” to sleep remotely:
  4. You’ll receive a confirmation message when the computer has finished waking up or going to sleep. If you just woke it up, you can now perform normal remote access tasks, like SSH, FTP, or Windows Remote Desktop.

Ready to set this up for yourself? Visit the GitHub Project Wiki to follow the detailed installation instructions.


  • 7/20/2013: Added the ability to put the computer back to sleep using the mobile webapp. Instructions updates on the Wiki.
  • 12/15/2013: The app now includes a dropdown that allows you to pick a computer. You can now Wake/Sleep as many computers as you want! Thanks to GitHub user ahodgey for submitting a Pull Request with most of this functionality (I made some updates to his pull request, and merged it into the master repository branch).
  • 09/14/2015: The Raspberry Pi WOL software now supports SSL encryption, meaning you can connect over HTTPS using a self-signed certificate. Additional security measures have also been implemented to reduce the risk of XSS vulnerabilities. Thanks to GitHub user felixrr for the Pull Request! You can still use ordinary HTTP if desired, and updated instructions can be found on the Wiki.
  • 01/24/2015: Software bumped to v2.0. Fixed lots of bugs, and confirmed working latest Raspbian Jessie release, with Apache 2.4.x (which had a bunch of breaking changes).

Supporting Documentation and Code

This project is licensed the GNU GPL v3. Please Attribute and Share-Alike. You can download the source directly from the GitHub Repository linked below.

Get it on GitHub


  1. I have used my rpi long time for this purpose and it was working very fine. Now I had to reinstall my rpi and followed the instructions again. I replaced php5 with php7.0 where needed (or php/7.0/ in paths)

    The wakeup is working, but.. the pinger is nog getting back into the website… I mean, if I use the passphrase and the Wake UP! button, my PC wakes up, but the page never shows the “It’s Alive!”

    What could that be ?

  2. Nevermind .. my brain was thinking in the wrong IP range that I use a lot at work and it is very similar to the range at home but slightly differnet

  3. Any of you guys ever found a way to set several different passwords for different computeres?

    Would be amazing if could be done. Imagine its only adding a few more lines to the code.

  4. Hi there Guys,

    Has anyone ever managed to get this working on a DietPi Installation? I love this app and have followed all the instructions and it all works apart from it will not wake a PC, however, the website will confirm that a PC is awake / Asleep and seems to sleep but not wake? any help would be greatly appreciated, guys.

    Many thanks in advance.

  5. I’ve been using this for years on an old model b running wheezy and recently decided to upgrade to the latest version stretch via a clean install but cannot get this to work. It sees my PC and shows it status correctly but does not issue the wake or sleep command to the PC even though it says it has.
    I restored my backup of wheezy to the sd card and its all working again fine.
    As I have a new pi3 now as well I tried installing it on that but the result is the same – the old wheezy server works but the new stretch one does not.
    Any ideas whats going wrong?
    I have read through some of the comments and tried one persons suggestion of adding a – i prefix to the MAC but this made no difference.
    Comparing the index.php files and the config.php files shows no major differences as far as I can see.

  6. Same issue as Matt Wood. I have installed on pi3

    • I actually resolved this by changing the php7 links to php5 as it was just failing to properly configure all of the components due to the links being incorrect on some of the lines. It’s now working fine on the rpi1 with Stretch.

  7. Hi, I just did a clean install on a rpi3 with Stretch. I think there is still a mistake in the installation instruction when. In general, the instruction has been updated to reflect the change from php5 to php7. However this line (as of today):

    sudo apt-get install wakeonlan apache2 php git php5-curl libapache2-mod-php

    should be like

    sudo apt-get install wakeonlan apache2 php git php7.0-curl libapache2-mod-php

    This worked for me.

    • the command “sudo apt-get install wakeonlan apache2 php git php7.0-curl libapache2-mod-php” failed when I tried it, I worked around it replacing “7.0” with “7.3”

  8. I have been using this tool for years on a Raspberry (1)B+. The OS version I was using was really outdated (wheezy), so I tried to update it… big mistake, the upgrade process messed up with apache files and directories and the tool ended up broken. So I downloaded the latest version of Raspbian (Buster lite), and after flashing the SD card and setting up the OS, I followed the tool installation from scratch (no ssh encryption, I had the feeling it was going to give me headaches). It took me a couple hours, but it’s now up and running again. Thanks again, Jeremy.
    PS: the commands regarding to PHP 7.0 will fail, I worked it around replacing 7.0 with 7.3.

Leave a Reply to Bart S Cancel reply

Required fields are marked *.

This site uses Akismet to reduce spam. Learn how your comment data is processed.