Ubiquiti only officially supports installing the UniFi SDN controller on Debian and Ubuntu. If you prefer CentOS, the process to install the UniFi SDN controller is below.

Step-by-step guide


Most of these commands must be run as root, so either log in as root or use sudo.


Any commands starting with nano can be substituted with vi if nano is not installed.


  1. Install the EPEL repo

    yum install epel-release


  2. Add a user account to run the controller

    useradd -r ubnt


  3. Install MongoDB version 3.4
    1. Create the repo file

      nano /etc/yum.repos.d/mongodb-org-3.4.repo


    2. Paste the contents into the file

      [mongodb-org-3.4]
      name=MongoDB Repository
      #baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
      #hard-coded release number since there is not one for CentOS 8
      baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.4/x86_64/
      gpgcheck=1
      enabled=1
      gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc


    3. Save the file
    4. Refresh the repo list


      yum repolist


    5. Install the package


      yum install mongodb-org


  4. Install Java 8
    1. Change directory into the temp folder


      cd /tmp


    2. Download the package


      Go to the Java Manual Downloads page and get the URL for Linux x64 RPM.


      wget https://the-url-from-java-download-page


    3. Find the name of the package that was downloaded. It should be something likeĀ jre-8u161-linux-x64.rpm
    4. Install the RPM package

    5. yum localinstall jre-8u161-linux-x64.rpm


  5. Install the generic Linux version of the UniFi SDN controller
    1. Find the latest version number from the UniFi download page
    2. Download the ZIP file

      wget https://www.ubnt.com/downloads/unifi/[version]/UniFi.unix.zip


      Fill in [version] with the correct version number. ex. /unifi/5.11.50/UniFi.unix.zip


    3. Unzip the contents

      unzip -q UniFi.unix.zip -d /opt


    4. Set the correct owner for the new files

      chown -R ubnt:ubnt /opt/UniFi


    5. Create the startup script

      nano /etc/systemd/system/unifi.service


    6. Paste the contents into the new startup script

      # Systemd unit file for UniFi Controller #
      
      [Unit]
      Description=UniFi Controller
      After=syslog.target network.target
      
      [Service]
      Type=simple
      User=ubnt
      ExecStart=/usr/bin/java -Xmx1024M -jar /opt/UniFi/lib/ace.jar start
      ExecStop=/usr/bin/java -jar /opt/UniFi/lib/ace.jar stop
      SuccessExitStatus=143
      
      [Install]
      WantedBy=multi-user.target


    7. Set the service to start on system boot

      systemctl enable unifi


    8. Start the service

      systemctl start unifi


  6. Open firewall ports
    1. Open the web admin interface port

      If your server is connected directly to the Internet, you should not open web admin ports for security reasons. Admin ports should be accessed through a secure channel, like a VPN.


      firewall-cmd --permanent --add-port=8443/tcp


    2. Open the two ports needed for device management



      firewall-cmd --permanent --add-port=8080/tcp


      firewall-cmd --permanent --add-port=3478/udp


    3. Reload the firewall for settings to take effect

      firewall-cmd --reload


  7. Go to your controller's web address in a browser.
    1. The address will be the FQDN or IP followed by the admin port, 8443.

      https://192.168.1.100:8443


    2. It is safe to bypass certificate warnings since the controller does not have publicly trusted certificates installed.
  8. That's it! Everything should be working!


Related articles

Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.



Related issues