How to Control Your ESP8266 From Anywhere in the World

Hey there,

The most common questions I get about the ESP8266 WiFi Modules are: “Is it possible to control my ESP8266 from anywhere in the world?” and “How can I control my ESP8266 from anywhere?”.

I’m happy to announce today that I have a solution for that problem.

Read: Control ESP32 and ESP8266 GPIOs from Anywhere in the World has been discounted, please use the new version of this project: Control ESP32 and ESP8266 GPIOs from Anywhere in the World.

Watch the video demonstration below (discontinued)

Step #1 – Register Your Free Account (discontinued)

First you need to create your free account at Home Automation Server. Go to, type all your details and submit your registration.

Then go to your email address, confirm your account and login into your account.

Important: Please note that this is the new version of Home Automation Server, if you already created an account in the old Home Automation Server your account still works with the same login details. You can reset your password here.


Step #2 – Adding an ESP8266 to Your Dashboard

When you login for the first time you’ll need to click the green button that appears (see Figure below) that says “Click here to add your ESP8266”.


You  also need to upload some Lua code to your ESP8266. Click the gray button “First time here? Click here to generate your ESP8266 code”.


Follow the instructions that appear below the gray button:

  1. Flash your ESP8266 with NodeMCU firmware
  2. Upload the code generated at Home Automation Server to your ESP8266
  3. Follow these schematics below to control 2 LEDs with your ESP8266

Step #3 – Test It

Now you can control your ESP8266 GPIOs from outside your home network using any device that has browser!

Click the “Turn On” buttons to make your ESP8266 GPIOs go HIGH.


NOTE: The GPIOs of your ESP8266 are updated every 20 seconds, please respect the API calls limit so we don’t overload the server. Thank you!

Read our new solution: Control ESP32 and ESP8266 GPIOs from Anywhere in the World

If you like this post probably you might like my next ones, so subscribe my blog and my Facebook page. Thanks for reading,

-Rui Santos

Build Web Server projects with the ESP32 and ESP8266 boards to control outputs and monitor sensors remotely. Learn HTML, CSS, JavaScript and client-server communication protocols DOWNLOAD »

Build Web Server projects with the ESP32 and ESP8266 boards to control outputs and monitor sensors remotely. Learn HTML, CSS, JavaScript and client-server communication protocols DOWNLOAD »

Recommended Resources

Build a Home Automation System from Scratch » With Raspberry Pi, ESP8266, Arduino, and Node-RED.

Home Automation using ESP8266 eBook and video course » Build IoT and home automation projects.

Arduino Step-by-Step Projects » Build 25 Arduino projects with our course, even with no prior experience!

What to Read Next…

Enjoyed this project? Stay updated by subscribing our newsletter!

30 thoughts on “How to Control Your ESP8266 From Anywhere in the World”

  1. Hi Rui
    Great tutorial! Thank you!
    Is it possible to send data BACK to the site from the ESP?
    State of led / temperature perhaps?
    Any plans on a MQTT tutorial?

  2. Do you know how to do this if I programmed my ESP8266-01 using Arduino IDE?
    I cant seemed to program my ESP8266 using ESPlorer so I decided to use Arduino IDE.


  3. He rui I am in final year project control robot through iot like Ethernet shield or esp 8266.. Move robot forward, backward,left ,right …how I make..give me suggestion

      • u have work any gsm base controll robot ..put sim card in sim 900 gsm board & generate gprs so we controll robot through server website…sim900 gsm board interface with arduino uno………….
        & 2nd
        i am new in programmer how to controll robot like forward,backward,left,right,stop through server(IOT)..ethernet shield interface with arduino uno…give me code like controll robot forward,backward,left ,right,stop of arduino scketch & server code

  4. Hi Rui,
    very nice tutorial, i would to ask you 2 questions:
    1) if i want to control more than 2 output(LED), what can i do? is there another module?
    2) in this case is necessary to use a breadboard? I wanted to control a relay board

  5. Found the problem and though I should report the solution for other readers. The default NodeMCU install I had did not include the CJSON module. Fortunately Marcel Stoer’s custom build site allowed me to include this with the other reported modules as reported after a restart. His site is Hope it helps as this has cost me a couple of days – but I learned a lot including that not all answers come from google!

  6. This does not work with the ESP8266 – 12E board. There are compile errors when running the code, The information provided is unclear. What network name? What is #payload ?
    No need to go to any trouble trying to help me get this working because I am moving on to other solutions. Thanks anyway.

  7. Hello,
    we are from 4semitechnology Pvt Ltd, i tried to upload the code for ESP8266-01 but i am getting an error in uploading it. I have an doubt that should to use ESP dashboard app, should i download any related app or named as “dashboard” only.

    • Hi Karl.
      We’re no longer working on home automation server. We no longer accept registrations.
      I’m sorry about that.
      Sara 🙂


Leave a Comment

Download our Free eBooks and Resources

Get instant access to our FREE eBooks, Resources, and Exclusive Electronics Projects by entering your email address below.