Skip to content

UniFi Controller container setup

Introduction

The UniFi Controller is software that allows users to configure and monitor UniFi devices like access points, switches, and firewalls.

Setup

  1. Create the folders needed by the container

    Run the following commands inside your home folder:

    # Open your terminal application
    cd ~
    mkdir -p unifi/data
    mkdir -p unifi/log
    cd unifi
  2. Create the script needed to run the container

    Save the following script as unifi_run.sh:

    unifi_run.sh
    # To create this script use your text editor application, for example Nano
    IDu=$(id -u $(logname)) # Saves the logged in user id in the IDu variable
    IDg=$(id -g $(logname)) # Saves the logged in user group in the IDg variable
    docker run -d \
    --init \
    --name=unifi \
    --hostname=unifi \
    --net=host \
    -v $PWD/data:/unifi \
    -e RUNAS_UID0=false \
    -e UNIFI_UID=$IDu \
    -e UNIFI_GID=$IDg \
    -e TZ="Europe/Amsterdam" \
    --cap-add=NET_ADMIN \
    --restart=unless-stopped \
    jacobalberty/unifi
    # IMPORTANT: Please read the instructions below
    Instructions:
    • Optional Replace docker with podman if needed
    • Optional Replace --net=host with ports to pass through if you want to expose ports. Here is described how to check if ports are available
    • Optional Replace $PWD/unifi with your location if needed
    • Required Replace Europe/Amsterdam with your own timezone
  3. Run the script to create the container

    Run the following command:

    # Open your terminal application
    sudo sh unifi_run.sh

    The image jacobalberty/unifi is automatically pulled and the container is created.

  4. Check the results

    If needed you can check if the container is running properly.

    In a minute or two, (after UniFi Controller starts up) you can go to https://localhost:8443 to complete configuration from the web (initial install) or resume using UniFi Controller. Replace localhost with the relevant IP address or FQDN if needed, and adjust the port if you changed it earlier.

Favorites

Comments

    No comments found for this note.

    Join the discussion for this note on Github. Comments appear on this page instantly.

    Copyright 2021- Fiction Becomes Fact