How-to: Reset Unifi controller password hosted on Windows

A quick guide on how to reset the password for your Unifi Controller. You only need access to the Windows machine that is hosting the controller.

Table of Contents

My setup

Machine: Windows Server 2019 1809, build 17763.737
Unifi controller: 6.1.71
NoSQLBooster: 6.2.11

Step 1. Download and install NoSQLBooster

You need a program to open the Unifi controller database.
I recommend NoSQLBooster. It’s free, easy to install and easy to use.

So, Download and install NoSQLBooster.
Link to the program: NoSQLBooster

Step 2. Connect to the database

  1. Open NoSQLBooster.
  2. Click on “Connect” in the upper left corner.
  3. Click “Create”.
    Server = localhost
    Port = 27117
  4. Click “Save & Connect”

Step 3. Changing the password

  1. Navigate to Localhost > ace > admin
  2. Click on “admin” to mark it and press enter.
  3. Doubleclick on the “x_shadow” field.
  4. Replace the current text with this: $6$OzJJ0heL$XyD5qt4pviLieuj8CMFbnSc9VYvxDyzYpH7dHC8wmaLwKv9xwyDxBiMx3GcT8nEdIa7XJbqlZo39jhfbQBXRM/
  5. Close NoSQLBooster.

Step 4. Done

The password is now password123

I advise you to change that 😉

Video guide:


12 Responses

  1. Hi,

    Posting this was the least I could do to say a huge THANK YOU to you!
    You are a legend.
    This worked and fixed my issue in seconds.
    Ubiquiti support is so horrible it’s not even funny.

    They expected me either setup SMTP on my controller (which is trash and doesn’t work with my Gmail account which I use daily) or reinstall my controller and adopt each device separately.
    Hopefully after this breach, they learn and will implement things differently.

    Once again, thank you so much!


    1. Hello,

      I have connected to this using NOSQL just fine, but when it tells me to search for the x_shadow field, i do not have any entries. I have all the directors and i am under localhost>ace>admin, but nothing else is there and it says (0) next to it.

      This is the only machine the controller is installed on. I inherited this environment from a disgruntled IT admin who locked everyone out when she left, just trying to get back into the system. Any suggestions is greatly appreciated.

  2. This worked flawlessly and took less than 5 minutes….literally!

    Thank you sooooooooooooooooo much!

  3. When I open the program I dont get the ADMIN (1) like you show. Instead it shows Admin (2) with some other options. System vs 1 and users but no admin to select?


    1. What version is your unifi controller?
      Can you send a screenshot of your admin (2) and the other options?

  4. Thanks so much. *NOTE* I had to use the UniFi Controller program as shown in these instructions [my version 6.2.25] and not a direct query to the IP address of the controller.

  5. Thank you posting this. If this works you are a life saver! Here is the error I receive when trying to get the database.

    “message” : “failed to connect to server [localhost:27117] on first connect [Error: connect ECONNREFUSED” +
    “at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) {” +
    “name: ‘MongoNetworkError'” +
    “stack” : “MongoNetworkError: failed to connect to server [localhost:27117] on first connect [Error: connect ECONNREFUSED” +
    “at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) {” +
    “name: ‘MongoNetworkError'” +
    “}]” +
    “at Pool. (C:\\Users\\CliftonDavis\\AppData\\Local\\Programs\\nosqlbooster4mongo\\resources\\app.asar\\node_modules\\mongodb\\lib\\core\\topologies\\server.js:438:11)” +
    “at Pool.emit (events.js:203:13)” +
    “at C:\\Users\\CliftonDavis\\AppData\\Local\\Programs\\nosqlbooster4mongo\\resources\\app.asar\\node_modules\\mongodb\\lib\\core\\connection\\pool.js:562:14” +
    “at C:\\Users\\CliftonDavis\\AppData\\Local\\Programs\\nosqlbooster4mongo\\resources\\app.asar\\node_modules\\mongodb\\lib\\core\\connection\\pool.js:995:11” +
    “at C:\\Users\\CliftonDavis\\AppData\\Local\\Programs\\nosqlbooster4mongo\\resources\\app.asar\\node_modules\\mongodb\\lib\\core\\connection\\connect.js:32:7” +
    “at callback (C:\\Users\\CliftonDavis\\AppData\\Local\\Programs\\nosqlbooster4mongo\\resources\\app.asar\\node_modules\\mongodb\\lib\\core\\connection\\connect.js:280:5)” +
    “at Socket. (C:\\Users\\CliftonDavis\\AppData\\Local\\Programs\\nosqlbooster4mongo\\resources\\app.asar\\node_modules\\mongodb\\lib\\core\\connection\\connect.js:310:7)” +
    “at Object.onceWrapper (events.js:291:20)” +
    “at Socket.emit (events.js:203:13)” +
    “at emitErrorNT (internal/streams/destroy.js:91:8)” +
    “at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)” +
    “at processTicksAndRejections (internal/process/task_queues.js:77:11)”,
    “name” : “MongoNetworkError”

Leave a Reply

Your email address will not be published. Required fields are marked *