Enable Teleport VPN on Self-Hosted UOS After Migration

If you've migrated from a self-hosted UniFi Network Server to UOS Server, you may discover that Teleport VPN is unavailable after the migration. This happens because Teleport only works with the server's default site, and imported sites do not automatically become the default.

Teleport associates itself with the site marked as the default in MongoDB. During migration, imported sites retain their original identifiers while the automatically created default site remains the designated primary site. Updating these attributes changes which site UOS treats as the default.

This guide explains how to manually update the MongoDB database so your imported site becomes the default. Make a backup before proceeding, as this involves directly modifying the database.

!!!!!Warning!!!!

  • Editing the UniFi MongoDB database can permanently damage your configuration if done incorrectly.
  • Back up your UOS Server before making changes.
  • This procedure is unsupported by Ubiquiti.
  • Verify your Object IDs carefully before running any update commands.

Prerequisites

  • Self-hosted UOS Server
  • SSH access
  • Root or sudo privileges
  • Basic Linux command-line knowledge
  • Existing imported UniFi site
  • MongoDB CLI available

ssh user@your-server
Step 1 - Connect to the server
uosserver shell
Step 2 - Enter the UOS shell
mongo --port 27117
Step 3 - Open MongoDB
use ace
Step 4 - Switch to the UniFi Database
db.site.find()
Step 5 - List the sites in the database
{ "_id" : ObjectId("[hex number 1]"), "name" : "default", "attr_no_delete" : true, "attr_hidden_id" : "default", "desc" : "Default" }
{ "_id" : ObjectId("[hex number 2]"), "desc" : "[imported site description]", "name" : "[imported site name]" }
You should see at least 2 sites. There will be other columns but these are the ones we care about.

Step 5 - Use these commands to swap the site details

db.site.update({ _id: ObjectId("[hex number 2]") }, { $set: { desc: "default", attr_hidden_id: "default", attr_no_delete: true, name: "default" }})
Converts the imported site into the default site.
db.site.update({ _id: ObjectId("[hex number 1]") }, { $unset: { attr_hidden_id: "",attr_no_delete: ""}})
Removes the default-only attributes from the original site.
db.site.update({ _id: ObjectId("[hex number 1]") }, { $set: { name: "old_default", desc: "old_default"}})
Renames the old default site so it no longer conflicts.

Verify The Changes

db.site.find()
Step 6 - List the updated sites in the database

Confirm that:

  • Teleport appears under Settings → VPN after restarting UOS
  • The imported site is now named "default"
  • attr_hidden_id is set to "default"
  • attr_no_delete is present

Once we have confirmed the data looks correct, we can back out.

exit
Step 7 - Exit the Mongo DB CLI
exit
Step 8 - Exit UOS Server shell
uosserver stop
Step 9 - Stop UOS Server
uosserver start
Step 10 - Start UOS Server
  • Teleport appears under Settings → VPN after restarting UOS
  • With UID configured, One-Click options appear under Settings -> Identity
  • With my UTR, now I see a valid Teleport end point to connect to.

After restarting UOS Server, your imported site should become the active default site, enabling Teleport VPN and related Identity features. If the changes do not appear immediately, verify the database entries before making additional modifications.

Thank you for taking the time to read this article. If you found it useful, please share it with others.


Troubleshooting:

Teleport still doesn't appear

  • Clear browser cache
  • Wait several minutes after restarting
  • Verify the MongoDB changes
  • Confirm the imported site is now named "default"

MongoDB connection failed

Possible causes:

  • Wrong port
  • UOS shell not active
  • MongoDB service not running

Tested with:

  • UOS Server version: 5.1.19
  • UniFi Network version: 10.4.57
  • Last verified: July 2026