UniFi API Browser

August 27, 2022 · View on GitHub

A Docker image for UniFi API Browser

license release size docker github

UniFi-API-Browser

A Docker image for UniFi API Browser

This tool is for browsing data that is exposed through Ubiquiti's UniFi Controller API, written in PHP, JavaScript and the Bootstrap CSS framework.

The API Browser lets you pull raw, JSON formatted data from the API running on your controller.

Environment Variables

VariableRequiredDefaultDescription
CONTROLLER_IPIP address of the Unifi Controller
CONTROLLER_PASSthe password for access to the Unifi Controller
CONTROLLER_USERthe user name for access to the Unifi Controller. NOTE: use a 'Local Access' account, not a 'Ubiquiti Account'.
CONTROLLER_PORT443Port if you changed the port UniFi is running on
CONTROLLER_NAMEUniFi Controllername for this controller which will be used in the dropdown menu
DEBUGfalseset to 'true' (without quotes) to enable debug output to the browser and the PHP error log when fetching the sites collection after selecting a controller
UI_AUTHfalseenable/disable authentication
UI_NAVBAR_BG_CLASSdarkclass for the main navigation bar background, valid options are: primary, secondary, success, danger, warning, info, light, dark, white, transparent
UI_NAVBAR_CLASSdarkclass for the main navigation bar, valid options are: light, dark
UI_PASSsha512(admin)Generate a SHA512 of the password you want and put here, you can use a tool like https://sha512.online/ by default the password is 'admin'
UI_THEMEdarklyyour default theme of choice, pick one from the list below: bootstrap, cerulean, cosmo, cyborg, darkly, flatly, journal, lumen, paper readable, sandstone, simplex, slate, spacelab, superhero, united, yeti
UI_USERadminusername to secure the API Browser instance

Usage

To get started this is the minimum number of options:

docker run \
  --name unifi-api-browser \
  --publish 8000:8000 \
  --env CONTROLLER_IP= \
  --env CONTROLLER_PASS= \
  --env CONTROLLER_USER= \
  ahmadnassri/unifi-api-browser

The container will run on port 8000 by default.

Connecting to Multiple UniFi Controllers

Unifi-API-Browser supports multiple controllers. To use them create a copy of users-tempalte.php and config-template.php and mount them as volumes:

docker run \
  --name unifi-api-browser \
  --publish 8000:8000 \
  --env CONTROLLER_IP= \
  --env CONTROLLER_PASS= \  
  --env CONTROLLER_USER= \
  -v <HostPath>/config.php:/app/config/config.php \
  -v <HostPath>/users.php:/app/config/users.php \
  ahmadnassri/unifi-api-browser

Author: Ahmad Nassri • Twitter: @AhmadNassri