Ubiquiti has finally updated their UniFi Network Server / Controller software to play nicely with Apple Silicon. Previously, some annoying workarounds were necessary to get it running.

With this news, I set about to get into the software, only to find that my supposed password was incorrect. Since the server is running on my machine, there ought to be an easy way to reset the password locally, yet the only officially supported method seems to be to set up an email SMTP server for sending a password reset email - useless if you didn’t already set this up before forgetting the password.

However, there is another way. The password is stored in a MongoDB database which is accessible without authentication on the local machine. We can we can simply generate a new password, salt+hash it, and write that value to the database, setting a new password. These are the steps I followed:

  1. Install MongoDB Compass

  2. Open a connection to localhost:27117

  3. Select the ace database, then the admin document

  4. Open command line (should work on macOS, Linux, BSD, etc, as long as openssl is installed), and run openssl passwd -6 -salt 9Ter1EZ9$lSt6

  5. Type in the new password, then press ENTER

  6. Write the output of the openssl command into the x_shadow value in the MongoDB database. It should start with $6$.

  7. Click UPDATE to write the new value.

  8. Note the username under the name field of the ace.admin document in the MongoDB database.

  9. Log in to the Unifi controller with the username and new password you just set!

Note: My solution is based off of this forum post, but I opted to perform the password hashing locally and to use software from the MongoDB developers to connect to the database.