A simple captive portal HTTP server for NodeMCU ESP8266 devices running Lua
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



This is my fork of nodemcu-lua-server. I added the DNS redirection / captive portal via esp8266-captive-portal and modified the send commands to send valid HTTP responses (though I think I could have just used the http module 🤷)

IoT NodeMCU webserver

IoT Webserver for NodeMCU (written in Lua)


If you don't have any experience with ESP8266 and Lua, please check: IoT Esp8266 Lua Guide

  1. Clone / Download this repository.
  2. Install nodemcu-tool using npm:
npm install nodemcu-tool -g
  1. Optional: You can install lua linter - luacheck:
luarocks install luacheck


Before you start you have to update config.lua file and set WiFi credentials:

module.SSID["NAME"] = "PASSWORD"

Connect your NodeMCU to USB port and upload all lua scripts (/dev/cu.wchusbserial1410 - your device name might be different)

$ nodemcu-tool --port /dev/cu.wchusbserial1410 upload src/*.lua

If you're done you can try to connect to your NodeMCU:

$ nodemcu-tool --port /dev/cu.wchusbserial1410 terminal

In order to see NodeMCU / server logs press RESET button on the board - the webserver will restart and try to establish wifi connection again:

Connecting to YOUR_WIFI_NETWORK...
ESP8266 mode is: 1
MAC address is: 5e:cf:7f:1b:df:19
IP is
Server Started
Open in your browser

Follow the instruction and open your browser with given IP address:

NodeMCU WebServer Preview

Happy Hacking.



This project is distributed under the MIT license.