Setting up and customizing a UniFi Captive Portal
Published onby Iron
A Captive Portal is an excellent way to manage network access for guests, ensuring that they connect through a branded splash page before accessing the internet.
UniFi's Captive Portal feature provides a customizable solution for guest access, allowing network administrators to improve security, gather user data, and deliver a customuser experience.
In this blog post, we'll guide you through setting up and customizing a UniFi Captive Portal.
Let's go!
bring it on
Table of Contents
- What is a Captive Portal?
- Setting Up a UniFi Captive Portal
- Advanced customization
- Monitoring and Managing Guest Access
What is a Captive Portal?
A Captive Portal is a web page that users must view and interact with before they can access the internet. It commonly used in hotels, cafes, and other public venues, Captive Portals often require users to accept terms of service, enter a password, or provide personal information such as an email address.
This helps manage network access, enhance security, and even collect user data for marketing purposes.
Setting Up a UniFi Captive Portal
To set up a Captive Portal on your UniFi network, follow these steps:
Access the UniFi Controller
Log in to your UniFi Controller via your web browser. The Controller’s dashboard will provide an overview of your network and devices.
Create a Guest Network
- Navigate to the "Settings" section and select "Wi-Fi".
- Click "Create New Wi-Fi Network".
- Enter a name for your guest network (e.g., "Guest Wi-Fi").
- Under "Network", select "Guest" as the purpose.
- Configure other settings as needed (e.g., security options, VLAN ID).
- Click "Apply Changes".
Enable the Captive Portal
- Go to "Settings" > "Guest Control".
- Toggle "Enable Guest Portal" to ON.
-
Under "Authentication", select the method you prefer:
- No authentication: Users will only see the splash page.
- Simple password: Users must enter a password.
- Hotspot: Users must enter a voucher code or login credentials.
- Customize the "Redirect URL" if you want users to be redirected to a specific webpage after logging in.
Customize the Splash Page
- In the "Guest Control" section, click on "Customize Portal".
- You can use the built-in editor to modify the splash page or upload your own HTML file for full customization.
- Add your company logo, welcome message, and terms of service to give the portal a branded look.
- Save your changes.
Advanced customization
For more advanced customization, you can integrate third-party services or use the UniFi API.
This allows you to create dynamic portals that can interact with external databases, provide personalized content, or integrate with marketing tools.
Example: Customizing with HTML and CSS
If you choose to upload your own HTML file, you can create a fully customized splash page. Here’s a basic example:
<!DOCTYPE html>
<html>
<head>
<title>Welcome to Our Guest WiFi</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
background-color: #f4f4f4;
padding: 50px;
}
.container {
max-width: 600px;
margin: auto;
background: white;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
color: #333;
}
p {
color: #666;
}
</style>
</head>
<body>
<div class="container">
<h1>Welcome to Our Guest WiFi</h1>
<p>Please agree to the terms of service to connect.</p>
<form action="/guest/s/default/">
<input type="hidden" name="cmd" value="authenticate">
<button type="submit">Connect</button>
</form>
</div>
</body>
</html>
Upload this HTML file to your UniFi Controller, and it will be used as the splash page for your guest network.
Monitoring and Managing Guest Access
Once your Captive Portal is set up, you can monitor and manage guest access through the UniFi Controller:
- View connected clients: Go to the "Clients" section to see a list of all devices connected to your guest network.
- Generate reports: Use the "Insights" and "Statistics" sections to generate reports on guest network usage.
- Manage sessions: You can disconnect clients, extend session times, or generate vouchers (if using the Hotspot method).
Conclusion
Setting up a UniFi Captive Portal is a straightforward process that provides significant benefits for managing guest access.
Whether you opt for a simple setup or a fully customized solution, a Captive Portal enhances security, improves user experience, and provides valuable insights into network usage.
If you need someone to set this up or prefer a managed solution, we at UniHosted specialize in hosting and managing UniFi Controllers, making network management seamless for you.If you would like me to personally walk you through UniHosted, you can schedule a call with me here.
We host UniFi Controllers in the Cloud
Are you ready to take your UniFi Network to the next level? Deploy a UniFi Cloud Controller in minutes and manage your network from anywhere.
Free tier available
Get the best support
Join 1660+ customers
No credit card required