Ubiquiti recently released UniFi OS Server for managed service providers (MSPs) and power users looking to self-host their own UniFi controllers. Think of it as the next-generation hosted UniFi controller with a fully supported UniFi OS experience. In this post, I’ll walk you through the full setup process on a Linux-based cloud server, from deployment to securing it with SSL and locking it down with firewall rules.
And if you get stuck or want a professionally deployed UniFi OS environment, remember: Crosstalk Solutions is here to help! Contact us today!
Why Use UniFi OS Server?
Until now, running a self-hosted UniFi controller meant juggling updates manually, often through clunky CLI processes that could easily break things. UniFi OS Server changes the game by bundling the controller inside a containerized UniFi OS environment, complete with automatic updates for UniFi apps and the OS itself.
Some standout benefits:
- Auto-managed updates for UniFi OS and applications
- Access to premium features like UniFi Site Magic, InnerSpace, and Identity
- Cloud portal integration via unifi.ui.com for centralized control
- Ideal for managing non-UniFi OS devices like UXG Pro, Gateway Max, and others
If you’re an MSP managing multiple clients or a network admin building serious infrastructure, this is the route you want.
Choosing the Right Platform: Linux Is King
UniFi OS Server is available for Windows, macOS, and Linux, but let’s be real. If you’re just testing it out on a home lab or running a single site, sure, use Windows or macOS. But if you’re deploying this in production or managing multiple customers, Linux is the only serious option. Not only is it better supported, but it’s also more robust and scalable.
In this walkthrough, we deploy on a DigitalOcean Linux droplet, but the process is applicable to any cloud provider or bare metal server you prefer.
Step 1: Deploying the Linux Server
We start by creating a Linux virtual machine (droplet) in DigitalOcean with Ubuntu as the OS. I recommend a minimum of 2GB RAM and 50GB disk space, which exceeds UniFi OS Server’s base requirements and gives you a bit of breathing room.

You’ll also want to assign a fully qualified domain name (FQDN) to your server, something like unifiosserver.yourdomain.com. This is essential for setting up a valid SSL certificate later using Let’s Encrypt.

While the droplet is being created, head over to your DNS provider (I use Cloudflare which is super easy for the Let’s Encrypt steps below) and create a new A-Record for your server. This will be your FQDN (unifiosserver.yourdomain.com) + the IP address of your Digital Ocean droplet.
Step 2: Initial Server Setup
Once your droplet is live, log in via SSH and apply all system updates.
apt-get update && apt-get upgrade -y
From there, install podman, the container engine UniFi OS Server runs on (similar to Docker, but Ubiquiti’s chosen tool).
apt install podman -y
Next head to the UniFi OS Server 4.2.23 release page (or find the latest version) and scroll towards the bottom to the Download links section. Right-click on Linux (x64) and choose ‘Copy link address’
***NOTE: Version has changed since the release of this tutorial. Current version as of 1/10/26 is 5.0.6 and it can be found here.

Now type the following in the Linux CLI to download and install UniFi OS Server (SHIFT+INS to paste the copied URL into the CLI):
wget https://fw-download.ubnt.com/data/unifi-os-server/8b93-linux-x64-4.2.23-158fa00b-6b2c-4cd8-94ea-e92bc4a81369.23-x64
chmod +x 8b93-linux-x64-4.2.23-158fa00b-6b2c-4cd8-94ea-e92bc4a81369.23-x64
(Substitute the actual file name downloaded if the version is different). This sets the installer to be executable. Finally, run the executable like this:
./8b93-linux-x64-4.2.23-158fa00b-6b2c-4cd8-94ea-e92bc4a81369.23-x64 install
After it finishes, give it a minute or so to boot, then access it via https://your-server-ip:11443. You’ll get a browser warning at this point because SSL isn’t set up yet, but we’ll take care of that soon.
UPDATE: 9/10/2025: I’ve now had my UniFi OS Server in production for just over a month, and one thing that I’ve noticed is that it locks up with 100% CPU utilization every 4-5 days (I emailed my contacts at Ubiquiti about this, but I never heard back). The band-aid fix is to stop and restart the server with:
UPDATE: 11/12/2025: the swapfile does NOT fix the server locking up (though it’s still a good idea to implement). I have not yet found a fix for the lock-ups.
UPDATE: 1/10/2026: I have updated my own instance of UniFi OS Server to the latest (v5.0.6) using GlennR’s easy upgrade script. I will give it some time to see if the 4-5 day lockups have been fixed, but there is no mention of that issue in the release notes.
uosserver stop
uosserver start
This brings it back online, but it’s annoying to have to do that every few days. I thought perhaps maybe the server needs a swapfile to help alleviate that issue, so I added a 2G swapfile to my own server. I haven’t given it enough time yet as of the writing of this update to see if it solves that issue or not, but I will post an update in a week or two.
In the meantime, if you want to add a swapfile to your own server, this is how it’s done:
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
Now that you have your swapfile created and activated, it needs to survive a reboot. To do that, we need to add a line to the /etc/fstab file, so first edit it with:
sudo nano -w /etc/fstab
Then add this line:
/swapfile none swap sw 0 0
CTRL+X followed by Y to save and exit, and you’re all done.
Step 3: First-Time Setup and Multi-Site Mode
Once the web UI loads, walk through the initial configuration: name your server, sign in with your Ubiquiti account, and skip the backup restore if this is a fresh install.
Next, if you’re managing multiple clients or sites, enable multi-site mode from the settings menu. This lets you logically separate each customer’s devices and configurations, which is essential for MSP workflows.

BTW: Need help designing a multi-tenant UniFi environment? That’s exactly the kind of project we assist with at Crosstalk Solutions! Contact us today!
Step 4: Adding SSL with Let’s Encrypt
To secure your server with HTTPS, we use Let’s Encrypt along with DNS-based validation via Cloudflare. This avoids the need to open port 80, which is typically required for HTTP challenges. The process involves generating a Cloudflare API token, updating a configuration file on your server, and then running Certbot to obtain the certificate.
Follow the instructions written by awesome community member MiranoVerhoef: https://github.com/MiranoVerhoef/UniFi-OS-Server-SSL-Import
The only thing these instructions don’t properly cover is how to get your Cloudflare API token. To do that, log into Cloudflare, click your profile in the upper right-hand corner, and choose ‘Profile.’
Then pick API Tokens from the left-hand menu and click Create Token.

Click ‘Use template’ next to ‘Edit zone DNS’ and then under ‘Permissions,’ add a new one for Zone DNS Read.

Under ‘Zone Resources,’ select your domain. Then click ‘Continue to summary’ at the bottom followed by ‘Create Token’ on the following page.

You should now have your API token. Copy it and save it in a safe location. This is the only time your token will ever be displayed!
Head back to Mirano Verhoef’s github page and follow the remainder of the instructions. Once you run the final script, it will stop UniFi, install the cert, and then restart UniFi. Give it about a minute and you should now be able to browse securely to the UniFi OS Server with your FQDN.
Step 5: Locking Down with UFW Firewall Rules
Out of the box, your server has every port wide open, which we obviously don’t want. Using UFW (Uncomplicated Firewall), we configure strict rules that only allow the specific ports UniFi requires, plus SSH (ideally locked down to your own IP).
Copy/paste these commands one by one to set up the UniFi OS Server firewall:
UFW firewall rules
# It is a good practice to start by resetting UFW to a clean state.
# WARNING: This will remove all existing rules.
# You will be prompted to confirm this action.
sudo ufw reset
# Set the default policy to deny all incoming traffic and allow all outgoing traffic.
# This is a secure starting point.
sudo ufw default deny incoming
sudo ufw default allow outgoing
# UniFi Network Application Ports (both TCP and UDP unless specified)
# The 'allow' command with just a port number automatically applies to both TCP and UDP.
# UniFi Network Discovery (STUN)
sudo ufw allow 3478 comment 'UniFi Discovery'
# UniFi Network Controller ports
sudo ufw allow 5005 comment 'UniFi Controller Discovery'
sudo ufw allow 5514 comment 'UniFi Remote Logging'
sudo ufw allow 6789 comment 'UniFi Device Adoption'
sudo ufw allow 8080 comment 'UniFi HTTP Portal'
sudo ufw allow 8443 comment 'UniFi HTTPS Portal (Web UI)'
sudo ufw allow 8880 comment 'UniFi HTTP Redirect'
sudo ufw allow 8881 comment 'UniFi HTTPS Redirect'
sudo ufw allow 8882 comment 'UniFi STUN Server'
sudo ufw allow 9543 comment 'UniFi API'
sudo ufw allow 10003 comment 'UniFi AP/Device Monitoring'
sudo ufw allow 11443 comment 'UniFi WebSockets'
# UniFi Network Server Port, not used in all versions, but good to add
sudo ufw allow 8843 comment 'UniFi Server Port'
# UniFi Hotspot Portal
sudo ufw allow 8880 comment 'UniFi Hotspot Portal'
# Allow SSH (port 22) from your specific WAN IP subnet only
# Replace '1.2.3.4/32' with your actual WAN IP/subnet if different.
sudo ufw allow from 1.2.3.4/32 to any port 22 proto tcp comment 'Allow SSH from trusted subnet'
# Enable the firewall to apply the rules.
# WARNING: After running this command, only the ports and IPs you have explicitly
# allowed will be able to connect to the server.
sudo ufw enable
# Verify that all rules have been configured correctly.
sudo ufw status verbose
After applying and enabling the rules, verify you still have access and that UniFi is working as expected. Always test SSH in a second session before closing your terminal, just in case something went wrong.
Step 6: Adopting a Gateway from a Remote Site
As a final test, I connected a UniFi UXG Gateway from a separate internet connection (via T-Mobile Home Internet) to simulate a remote client site. After preconfiguring the site’s network settings and adopting the gateway via UniFi’s UI, everything worked seamlessly, including firmware updates and full management.
This proves the setup works not just in theory, but in real-world, multi-site scenarios.
Wrapping Up
UniFi OS Server is the future of self-hosted UniFi, and in my opinion, the best option for MSPs and network professionals who want control, scalability, and ease of use. With features like auto updates, multi-site management, and tight integration with the cloud portal, it finally brings the convenience of cloud hosting to self-managed environments.
And if you need help getting your UniFi OS Server up and running (or want to outsource the whole thing), Crosstalk Solutions is here for you. We offer design, deployment, troubleshooting, and managed support for everything UniFi and beyond.
