Family Encyclopedia >> Electronics

How to Transform Your Raspberry Pi into a Secure Captive Portal Wi-Fi Hotspot: Expert Guide

As a business owner offering free Wi-Fi, someone monetizing network access, or a homeowner enforcing guest etiquette, a captive portal adds control and professionalism. With years of hands-on Raspberry Pi projects, I'll guide you through turning your Pi into a reliable captive portal hotspot using proven tools like RaspAP and Nodogsplash.

Table of Contents

Why You Need a Captive Portal

If you've connected to 'open' Wi-Fi at a coffee shop, hotel, or gym only to hit a login page requesting your email or terms acceptance, that's a captive portal in action. It intercepts browser traffic, forcing users to interact before granting full access.

Businesses use them for marketing or payments, but they're equally valuable at home—for instance, a kids' network with reminders about responsible browsing, even if they bypass via VPN.

What You'll Need

To follow this tutorial:

  • Raspberry Pi running Raspberry Pi OS (models with Ethernet: Pi 3, 4, etc.; not Pi Zero or 2)
  • Compatible power cable
  • External keyboard
  • HDMI or micro-HDMI cable
  • External monitor
  • Ethernet cable (required for initial setup)

Getting Started: Update Your Raspberry Pi

Connect your keyboard, monitor, Ethernet, and power. Open a terminal:

sudo apt update && sudo apt -y upgrade

Reboot:

sudo reboot

Your Pi is now fully updated.

Set Up a Wireless Hotspot with RaspAP

RaspAP simplifies access point setup. In terminal:

curl -sL https://install.raspap.com | bash
How to Transform Your Raspberry Pi into a Secure Captive Portal Wi-Fi Hotspot: Expert Guide

Connect to the new network (default password: "ChangeMe"). Change it immediately for security.

Secure Your Wi-Fi Hotspot

  1. Open browser to 10.3.141.1 (admin/secret).
  2. Go to Hotspot > Security.
How to Transform Your Raspberry Pi into a Secure Captive Portal Wi-Fi Hotspot: Expert Guide How to Transform Your Raspberry Pi into a Secure Captive Portal Wi-Fi Hotspot: Expert Guide

Set a strong PSK password and save.

Create a Captive Portal with Nodogsplash

Install dependencies:

sudo apt install git libmicrohttpd-dev

Clone and build:

cd ~
git clone https://github.com/nodogsplash/nodogsplash.git
cd ~/nodogsplash
make
sudo make install

Configure Your Captive Portal

Edit config:

sudo nano /etc/nodogsplash/nodogsplash.conf

Add:

GatewayInterface wlan0
GatewayAddress 10.3.141.1
MaxClients 250
AuthIdleTimeout 480

Save (Ctrl+O, Ctrl+X). Start:

sudo nodogsplash
How to Transform Your Raspberry Pi into a Secure Captive Portal Wi-Fi Hotspot: Expert Guide

Test by connecting—portal appears.

Ensure Your Portal Runs on Boot

Edit rc.local:

sudo nano /etc/rc.local

Add nodogsplash before exit 0. Save and reboot.

How to Customize Your Captive Portal

Edit the splash page:

sudo nano /etc/nodogsplash/htdocs/splash.html

Add your branding, images, or rules.

How to Transform Your Raspberry Pi into a Secure Captive Portal Wi-Fi Hotspot: Expert Guide

Save, reconnect (clear cache if needed).

How to Transform Your Raspberry Pi into a Secure Captive Portal Wi-Fi Hotspot: Expert Guide

Bonus: Use your Pi for ad-blocking or a web server too. Share your setup in comments—home rules, business promo, or guest welcome?