Guide to installing the new Unifi Network Application on Portainer

Working on a YouTube video. :slight_smile:

Introduction: With the upcoming deprecation of the old UniFi Controller in 2024, it’s essential to transition to the newer version of the UniFi Network Application. This post guides you through the process using Docker and Portainer, ensuring a smooth upgrade.


  • Docker installed on your system
  • Basic knowledge of Docker and Docker Compose
  • Access to Portainer UI


You will need to backup the old unifi controller and restore in the new one.

Setup Steps:

  1. Generate init-mongo.js: Start by running the script to create the MongoDB user for UniFi. Open your terminal and execute:
bash -c "$(wget -qLO -"

Follow the prompts provided by the script.

  1. Prepare Docker Compose: Download the Docker Compose file from this GitHub repository. This file defines the UniFi Controller and MongoDB services.

  2. Deploy on Portainer:

  • Go to Stacks > Add Stack in Portainer.
  • Name your stack (e.g., unifi-stack).
  • Paste the Docker Compose content into the Editor.
  • Click on “Deploy the stack” to start the services.

Screenshot 2023-10-29 at 11.47.08 AM

  1. Deploying the UniFi stack on Portainer
  2. Initial Configuration: Once the stack is deployed, you might need to restart the UniFi container for it to connect successfully to MongoDB. After a few minutes, access the UniFi setup wizard at https://[YOUR_PORTAINER_IP]:8443 and follow the on-screen instructions to complete the setup.

Conclusion: You’ve now successfully set up the new UniFi Network Application on Docker using Portainer.