UniHosted at UniFi World Conference

How to self-host UniFi Controller

Published onby Iron (edited on )

So, you want to host your own UniFi controller, huh? Good choice! Hosting your own controller gives you full control, better customization, and lower long-term costs. It’s a project for network enthusiasts, IT pros, and small business owners who want to avoid paying for a Cloud Key or a hosting service.

Let's dive in!

Table of Contents

Why Self-Host a UniFi Controller?

Here’s why people love self-hosting their UniFi controllers:

  • Save Money: No need to buy a Cloud Key or Dream Machine.
  • Full Control: Own your data, updates, and configurations.
  • Customization: Add scripts, change ports, and set it up your way.
  • Multi-Site Management: Manage multiple UniFi networks from one controller.

⚠️ Things to watch out for

Self-hosting a UniFi Controller can work great… until it doesn’t. Here are the common failure points we see:

  • Maintenance Overload: Backups, OS updates, controller upgrades — all on your plate. Forget one, and you could lose client configs or knock the controller offline.
  • Scaling Pains: Managing 1–2 sites? Fine. Managing 10+ across VLANs and time zones? That’s when things start to creak.
  • Security Blind Spots: Weak SSL, exposed ports, stale software — unless you're actively hardening your server, you might be opening doors you didn’t mean to.
  • “Oh shit" Moments: Your controller dies. Your client’s network is down. Guess who’s on the hook?

✅ Want to avoid all this?

If you're looking for peace of mind, we built UniHosted exactly for this reason:

  • We handle updates, backups, and 24/7 monitoring.
  • Instant deployment, scalable infrastructure, and support from folks who actually run controllers at scale.
  • And yes — free tier available.

Feel free to book a demo to discuss your setup

What you need to get started

  1. Hardware: PC, server, VPS, or Raspberry Pi.
  2. Operating System: Linux (Ubuntu or Debian), macOS, or Windows.
  3. Software: Java and the UniFi controller software.
  4. Internet Access: If you want to access it remotely.

Hardware Options

Option Use Case Power Usage
Raspberry Pi 4 Great for home users Minimal (low cost)
Old Laptop/PC Home use/small offices Medium (higher cost)
Cloud VPS Remote & 24/7 access Zero at home, monthly VPS cost
Dedicated Server Large deployments High power/costs

Step 1: Install UniFi Controller

Depending on your operating system, the process differs slightly. Here’s a breakdown for Linux, Windows, and macOS.

Option 1: Install on Linux (Debian/Ubuntu)

If you have a Raspberry Pi, server, or VPS, Linux is the way to go. It’s lightweight, stable, and free.

  1. Update Your System

    sudo apt update && sudo apt upgrade -y
    
  2. Install Java

    sudo apt install openjdk-8-jre-headless -y
    
  3. Add Ubiquiti’s Repository

    echo 'deb https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/ubiquiti.list
    
  4. Install UniFi

    sudo apt update
    
    sudo apt install unifi -y
    
  5. Start the Controller

    sudo systemctl start unifi
    
  6. Enable on Boot

    sudo systemctl enable unifi
    
  7. Access the Controller Visit https://localhost:8443 in your web browser.

Option 2: Install on Windows

This is the easiest method, but it requires the Windows machine to be on 24/7.

  1. Download the UniFi Controller from the Ubiquiti website.
  2. Run the installer and follow the prompts.
  3. Launch the UniFi controller and visit https://localhost:8443.

Option 3: Install on macOS

  1. Download the macOS version of the UniFi controller.
  2. Install it like any other app.
  3. Open it and follow the setup wizard.

Step 2: Access and Configure the UniFi Controller

Once the controller is up, configure it.

  1. Access the Web Interface

  2. Follow the Setup Wizard

    • Create a username and password.
    • Configure network details.
    • Set up Wi-Fi networks if needed.
  3. Adopt UniFi Devices

    • Connect UniFi access points, switches, and cameras.
    • Use the “Adopt” button to bring devices under management.

Step 3: Secure Your Controller

If your controller is open to the web, securing it is crucial. Follow these tips:

  1. Enable 2-Factor Authentication (2FA)

    • Go to Account Settings > Security.
    • Enable 2FA with Google Authenticator or Authy.
  2. Limit IP Access

    • Set firewall rules to only allow trusted IPs.
  3. Disable Unused Ports

    sudo ufw allow 8443
    
    sudo ufw allow 8080
    
    sudo ufw enable
    
  4. Use SSL Certificates

    • Replace the self-signed SSL certificate with a Let’s Encrypt certificate.

Step 4: Adopting UniFi Devices

To add devices like APs and switches, follow these steps.

  1. Factory Reset Devices: Hold the reset button for 10 seconds.
  2. Discover Devices: Use the UniFi mobile app or controller.
  3. Adopt Devices: Click "Adopt" in the controller.

If a device is "Managed by Other", SSH into it and run:

set-inform http://<controller-ip>:8080/inform

Step 5: Backup and Updates

Don’t let your hard work go to waste. Back up your configuration and keep your system updated.

Automatic Backups

Set up daily backups:

sudo crontab -e

Add this line:

0 2 * * * tar -czf /backups/unifi-backup-$(date +\%Y\%m\%d).tar.gz /var/lib/unifi/

Update UniFi Controller

sudo apt update && sudo apt upgrade -y

Troubleshooting Tips

Problem Solution
Can’t Access Web UI Check if UniFi is running: "sudo systemctl status UniFi"
Adoption Failed SSH into device, run "set-inform"
Device Offline Reboot device, check firewall rules

Self-Hosted vs. Cloud-Hosted

Self-Hosted: Full control but requires you to manage updates, backups, and security.

Cloud-Hosted: Easier setup and maintenance. Services like UniHosted offer cloud-based UniFi controllers for a small fee. No hardware needed, and they handle updates, security, and uptime.

Recommendation: If you want no-hassle hosting, check out UniHosted.

Final Thoughts

Running a self-hosted UniFi Controller is satisfying, especially for tech enthusiasts. You save money, get full control, and learn some cool IT skills.

But if you’re looking for simplicity and don’t want the headache of server management, cloud-hosted solutions like UniHosted are worth checking out.

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.

Deploy Now

Free tier available

Get the best support

Join 1660+ customers

No credit card required