# Unifi



# Migrating to new Controller

1. Take a backup of the old server
2. Restore the backup onto the new server
3. on the old server set the override inform host option to point at the new controller
4. verify the devices have shown up in the new controller
5. shutdown the old controller

# Setting up the UniFi Network Controller using Docker

[https://pimylifeup.com/unifi-docker/](https://pimylifeup.com/unifi-docker/)

[https://community.ui.com/questions/How-To-Unifi-Contoller-Docker-home-network/fc6a9441-94b0-48b0-801a-6f38e2d4bb21](https://community.ui.com/questions/How-To-Unifi-Contoller-Docker-home-network/fc6a9441-94b0-48b0-801a-6f38e2d4bb21)

Once you have Docker installed, our next step is to prepare your system to run the UniFi Network Controller container.

The main thing we need to do here is create a directory to store the UniFi containers Compose file and all of its data.

You can create this directory by running the following command within the terminal.

```
```bash
sudo mkdir -p /opt/stacks/unifi
```<a class="copy-code-block fa-copy" href="https://pimylifeup.com/unifi-docker/#copy">Copy</a>
```

By utilizing the “`-p`” option, this command will create any missing directories in the given path.

**5.** After creating a directory to store our Compose file, we can change to the directory [by using the cd command](https://pimylifeup.com/cd-command/).

```
```bash
cd /opt/stacks/unifi
```<a class="copy-code-block fa-copy" href="https://pimylifeup.com/unifi-docker/#copy">Copy</a>
```

### Writing a Compose file for the UniFi Docker Container

**6.** Our next step is writing the Compose file for the UniFi docker container. This Compose file will instruct Docker what image to download and the environment variables to pass through to it.

You can begin writing this file by typing in the following command.

```
```bash
sudo nano compose.yaml
```<a class="copy-code-block fa-copy" href="https://pimylifeup.com/unifi-docker/#copy">Copy</a>
```

**7.** Within this file, you will want to type in the following lines.

You must replace “`<TIMEZONE>`” with a valid TZ Identifier. You can find a list of [time zone identifiers from Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).

For example, we would use “`Australia/Hobart`” for our time zone.

```
```yaml
services:
  unifi:
    user: unifi
    image: ghcr.io/jacobalberty/unifi-docker
    container_name: unifi-controller
    restart: unless-stopped
    ports:
      - "8080:8080"
      - "8443:8443"
      - "3478:3478/udp"
      - "10001:10001/udp"
    environment:
      TZ: "<TIMEZONE>"
    volumes:
      - ./data:/unifi
```<a class="copy-code-block fa-copy" href="https://pimylifeup.com/unifi-docker/#copy">Copy</a>
```

**8.** Once you have written the lines above, save and quit by pressing <kbd>CTRL</kbd> + <kbd>X</kbd>, followed by <kbd>Y</kbd>, and then the <kbd>ENTER</kbd> key.

### Starting the UniFi Docker Container

**9.** With the Compose file written, all you need to do to bring the UniFi network controller Docker container online is to use the following command.

We use the “`-d`” option to detach from the current terminal session once the container has started.

```
```bash
docker compose up -d
```<a class="copy-code-block fa-copy" href="https://pimylifeup.com/unifi-docker/#copy">Copy</a>
```

### Accessing the UniFi Network Controller Web Interface

**10.** Now that you have the Docker container for the UniFi network controller running, you will want to access its web interface. You will also need to know the IP address later in this guide.

If you don’t know the local IP address of your machine, you can get it by running the following command.

```
```bash
hostname -I
```<a class="copy-code-block fa-copy" href="https://pimylifeup.com/unifi-docker/#copy">Copy</a>
```

Ensure you set up your device with a static IP address before proceeding further. You do not want your UniFi controller to be assigned a dynamic IP address.

**11.** Once you know the IP address of your device, go to the following address in your favourite web browser.

Ensure that you replace “`<IPADDRESS>`” with your IP.

```
https://<IPADDRESS>:8443
```

### Initial Set Up of the UniFi Network Controller

**12.** When you first access your new Docker-based UniFi Network controller, you must complete some initial set up steps.

If you are setting up this controller as a brand new one, give it a server name, select your country, and accept the terms and conditions (**1.**).

After filling out your servers details, <kbd>click</kbd> the “`Next`” button (**3.**) to continue.

However, if you are restoring this from an older UniFi backup, <kbd>click</kbd> the “`Restore Server from a Backup`” link (**2.**)

<figure class="wp-block-image aligncenter size-full" id="bkmrk-">![Name your Docker UniFi Network Controller or Restore from Backup](https://pimylifeup.com/wp-content/uploads/2024/01/UniFi-Network-Controller-Docker-Container-01-Name-your-UniFI-Network-controller.jpg)</figure>**13.** If you are setting this controller up from scratch, you will now be asked to sign in to your Ubiquiti account (1.).

After filling out an email and password you can <kbd>click</kbd> the “`Create a UI Account`” button to create a new account, or you can <kbd>click</kbd> the “`Sign In`” button (**3.**) if you already have an account.

If you prefer not to use a Ubiquiti account on your controller, <kbd>click</kbd> the “`Advanced Setup`” link and follow the prompts (**2.**).

<figure class="wp-block-image aligncenter size-full" id="bkmrk--1">![Sign in to UI Account](https://pimylifeup.com/wp-content/uploads/2024/01/UniFi-Network-Controller-Docker-Container-02-Sign-in-to-UI-Account-or-Create-Local.jpg)</figure>**14.** At this point, you should now have access to the UniFi network controller web interface.

However, before you can start adopting your Ubiquiti network devices, there is an option you must enable.

<figure class="wp-block-image aligncenter size-full" id="bkmrk--2">![UniFi Network Controller Running in Docker Container](https://pimylifeup.com/wp-content/uploads/2024/01/UniFi-Network-Controller-Docker-Container-03-Network-Controller-Running.jpg)</figure>### Enabling the Inform Host Option

**15.** For your Ubiquiti devices to detect your Docker-based UniFi network controller, we must enable the “`Inform Host`” option.

This option lets us tell the IP address the controller should broadcast to available devices. Currently, it will be using the Dockers internal IP rather than the host IP.

To set this option, you must first switch to the settings page by <kbd>clicking</kbd> the cog in the sidebar.

<figure class="wp-block-image aligncenter size-full" id="bkmrk--3">![Open Settings page](https://pimylifeup.com/wp-content/uploads/2024/01/UniFi-Network-Controller-Docker-Container-04-Open-Settings-Page.jpg)</figure>**16.** Once you are on the settings screen, change to the “`System`” menu (**1.**).

After changing to the system settings page, swap to the “`Advanced`” tab (**2.**).

<figure class="wp-block-image aligncenter size-full" id="bkmrk--4">![Change to Advanced Settings](https://pimylifeup.com/wp-content/uploads/2024/01/UniFi-Network-Controller-Docker-Container-05-Change-to-Advanced-Settings.jpg)</figure>**17.** On this page, you should find an option labeled “`Inform Host`“.

<kbd>Click</kbd> the checkbox to allow us to begin overriding the host IP.

<figure class="wp-block-image aligncenter size-full" id="bkmrk--5">![Toggle on Inform Host](https://pimylifeup.com/wp-content/uploads/2024/01/UniFi-Network-Controller-Docker-Container-06-Enable-Inform-Host-Option.jpg)</figure>**18.** Before you can override the inform host value, you will get a warning that misconfiguring this option can cause you to lose access to your devices. You may have to physically reset your Ubiquiti devices if something goes wrong.

You need to ensure that the IP address of your host is correct and reachable. If you are happy to proceed, <kbd>click</kbd> the “`Confirm`” button.

<figure class="wp-block-image aligncenter size-full" id="bkmrk--6">![Confirm you want to Inform Host](https://pimylifeup.com/wp-content/uploads/2024/01/UniFi-Network-Controller-Docker-Container-07-Confirm-Override-Inform-Host.jpg)</figure>**19.** A text box will now appear below the “`Inform Host`” option. Type in the local IP address (**1.**) of the machine on which you are running the UniFi network controller using Docker.

Once you are happy that you have typed in the correct IP address, <kbd>click</kbd> the “`Apply Changes`” button (**2.**).

<figure class="wp-block-image aligncenter size-full" id="bkmrk--7">![Type in HOST IP For UniFi Docker Container Machine](https://pimylifeup.com/wp-content/uploads/2024/01/UniFi-Network-Controller-Docker-Container-08-Add-New-IP-for-Inform-Host.jpg)</figure>**20.** Once you have applied your settings, you must restart the UniFi Docker container.

Back in the terminal, you can bring the UniFi container down by using the following command

```
```bash
docker compose down
```<a class="copy-code-block fa-copy" href="https://pimylifeup.com/unifi-docker/#copy">Copy</a>
```

**21.** Start UniFi back up on your device by running the following command within the terminal.

```
```bash
docker compose up -d
```<a class="copy-code-block fa-copy" href="https://pimylifeup.com/unifi-docker/#copy">Copy</a>
```

## Updating your UniFi Docker Container

One massive advantage of using the UniFi network controller through a Docker container is that updating it is straightforward.

The following steps will walk you through the effortless way of updating to the latest version. You can see what versions are available by [visiting the GitHub page for this project](https://github.com/jacobalberty/unifi-docker/releases).

**1.** To update the UniFI container, we must change to the directory we created earlier in this guide.

We need to use the Compose file we wrote to pull the latest version of the image.

```
```bash
cd /opt/stacks/unifi
```<a class="copy-code-block fa-copy" href="https://pimylifeup.com/unifi-docker/#copy">Copy</a>
```

**2.** After swapping to the directory where we wrote the Compose file, you can use the command below to download the latest version of the UniFi container.

```
```bash
docker compose pull
```<a class="copy-code-block fa-copy" href="https://pimylifeup.com/unifi-docker/#copy">Copy</a>
```

**3.** Finally, if a new version is found, you can get Docker to move over to it using the command below in the terminal.

Docker will detect the new image and restart the container using it.

```bash
docker compose up -d
```

# Unifi Console Commands

[![image.png](https://docs.coltscomputer.services/uploads/images/gallery/2023-12/scaled-1680-/9kxzHIpRVSjbLed2-WQcimage.png)](https://docs.coltscomputer.services/uploads/images/gallery/2023-12/9kxzHIpRVSjbLed2-WQcimage.png)

[![image.png](https://docs.coltscomputer.services/uploads/images/gallery/2023-12/scaled-1680-/6332pJWcAx6cbJBR-8Viimage.png)](https://docs.coltscomputer.services/uploads/images/gallery/2023-12/6332pJWcAx6cbJBR-8Viimage.png)

[![image.png](https://docs.coltscomputer.services/uploads/images/gallery/2023-12/scaled-1680-/BfhplrAy9N03Y21v-iFXimage.png)](https://docs.coltscomputer.services/uploads/images/gallery/2023-12/BfhplrAy9N03Y21v-iFXimage.png)

[![image.png](https://docs.coltscomputer.services/uploads/images/gallery/2023-12/scaled-1680-/aZ7WqtPKMGuSPHw1-iiaimage.png)](https://docs.coltscomputer.services/uploads/images/gallery/2023-12/aZ7WqtPKMGuSPHw1-iiaimage.png)

Unifi SSH

# Unifi Controller as a Windows Service

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">How to Set Up the UniFi Network Controller as a Windows Service</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">1. Close any instances of the UniFi software on the computer. If the UniFi Network Controller was just installed, make sure to open the controller software manually at least once, or let it run at the end of the wizard. Once you see the message UniFi Controller (a.b.c) started, the controller may be closed.</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">2. Launch the Command Prompt as an Administrator. On Windows 10 this would entail right-clicking and selecting "Run as administrator". Please see Windows documentation to identify the appropriate method for your specific Windows version.</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">3. Change directory to the location of UniFi in the computer using the following command (exactly as it is here, no need to substitute anything):</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">cd "%UserProfile%\\Ubiquiti UniFi\\"</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">4. Once in the root of the UniFi folder, issue the following command to install the UniFi Network Controller service:</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">java -jar lib\\ace.jar installsvc</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">5. Once you're at a new command prompt line, after it says “Complete Installation…”, issue the following:</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">java -jar lib\\ace.jar startsvc</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">6. Close the command prompt window either by entering the exit command, or clicking the X.</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">7. To access the UniFi Network Controller now open a browser and go to https://localhost:8443. Alternatively, the desired interface IP, or FQDN that is mapped to that host (in place of “localhost”) may be used.</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">NOTE: We recommend using Oracle Java JRE 8, which can be downloaded in Oracle's website. For the UniFi Cloud Access portal (</span></span>[<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">https://network.unifi.ui.com/</span></span>](https://network.unifi.ui.com/)<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">) to work properly, only use x64 Java.</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">How to Upgrade a UniFi Network Controller that is Running as a Windows Service</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">1. Open the UniFi Network Controller and make a backup.</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">2. Launch the Command Prompt as an Administrator. On Windows 10 this would entail right-clicking and selecting "Run as administrator". Please see Windows documentation to identify the appropriate method for your specific Windows version.</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">3. Change directory to the location of UniFi in the computer using the following command (exactly as it is here, no need to substitute anything):</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">cd "%UserProfile%\\Ubiquiti UniFi\\"</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">4. Once in the root of the UniFi folder, issue the following to stop and uninstall the UniFi Network Controller service:</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">java -jar lib\\ace.jar stopsvc</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">java -jar lib\\ace.jar uninstallsvc</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">5. Once a new command prompt line is presented, that means uninstalling the service was successful. Update the UniFi Network Controller application's version with any of the regular methods. Go to Settings &gt; Maintenance in the Controller to upgrade to the latest public released version, or alternatively download the UniFi Network Controller installation package for Windows from the Downloads page or the Releases section of the Community.</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">6. Once the software update is successful, close the UniFi Network Controller application before going back to the Command Prompt.</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">7. In the Command Prompt issue the following to install the UniFi Network Controller service once again:</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">java -jar lib\\ace.jar installsvc</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">8. Once you're at a new command prompt line, after seeing the "Complete Installation…" message, issue the following:</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">java -jar lib\\ace.jar startsvc</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">9. Close the Command Prompt window either by entering the exit command, or clicking the X.</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543"> </span>

<span class="TextRun  BCX0 SCXO163085543" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun  BCX0 SCXO163085543">10.To access the UniFi Network Controller now open a browser and go to https://localhost:8443. Alternatively, the desired interface IP, or FQDN that is mapped to that host (in place of “localhost”) may be used.</span></span><span class="EOP  BCX0 SCXO163085543"> </span>

<span class="EOP  BCX0 SCXO163085543">Unifi</span>