Reply
Member
Posts: 105
Registered: ‎09-17-2014
Kudos: 42
Solutions: 4

Unifi Controller on Azure

[ Edited ]

I've documented how to create a Unifi Controller on AWS and GCP, so though I would do Azure as well.  At this time, I'm not aware of a free tier for Azure, so the following instructions would be a paid service from Azure.

Note: Azure's interface changes daily, so these instructions may not completely match the current interface.

At this time, Azure uses Ubuntu 16.03 as the TLS version.

 

  1. Create an Azure account and login to the portal website
    1. https://portal.azure.com
  2. Open the Azure Cloud Shell by clicking on the >_ icon at the top of the page AzureCloudShell2.JPG
  3. When/If prompted, select the Bash (Linux) option
    Bash.JPG
  4. The first time you enter th eAzure Cloud Shell, you will be prompted to setup storage, which you can accept the default or change Advanced options if desired
    3-Storage.JPG
  5. The following commands will create a Resource Group named Unifi-RG to hold all related components, create Network Security Group (Firewall) rules for the controller, and then provision a VM with a static IP and the NSG rules
    az group create --name Unifi-RG --location EastUS
    
    az network nsg create --resource-group Unifi-RG --name Unifi-Controller-NSG
    az network nsg rule create --resource-group Unifi-RG --nsg-name Unifi-Controller-NSG --name unifi-http --protocol tcp --priority 1000 --destination-port-ranges 80 8443 8880 8843 --access allow
    az network nsg rule create --resource-group Unifi-RG --nsg-name Unifi-Controller-NSG --name unifi-inform --protocol tcp --priority 1001 --destination-port-ranges 8080 --access allow
    az network nsg rule create --resource-group Unifi-RG --nsg-name Unifi-Controller-NSG --name unifi-stun --protocol udp --priority 1002 --destination-port-ranges 3478 --access allow
    az network nsg rule create --resource-group Unifi-RG --nsg-name Unifi-Controller-NSG --name unifi-throughput --protocol tcp --priority 1003 --destination-port-ranges 6789 --access allow
    az network nsg rule create --resource-group Unifi-RG --nsg-name Unifi-Controller-NSG --name ssh --protocol tcp --priority 1004 --destination-port-ranges 22 --access allow
    
    az vm create --resource-group Unifi-RG \
    --name unifi-controller \
    --location EastUS \
    --image UbuntuLTS \
    --generate-ssh-keys \
    --size Standard_B1s \
    --nsg Unifi-Controller-NSG \
    --public-ip-address-allocation static
  6. Once the VM is created, take note of the public IP address, using the GUI or the following command in the Cloud Shell
    az network public-ip list -g Unifi-RG | grep ipAddress
  7. Connect to the VM using SSH in the Cloud Shell to install the Unifi software, using the great scripts from Glennr found here: https://community.ubnt.com/t5/UniFi-Wireless/UniFi-Installation-Scripts-UniFi-Easy-Update-Scripts-Wo...
    As new versions are released, update the link and file name as needed.
    ssh PublicIPAddressHere
    wget https://get.glennr.nl/unifi/5.8.30/U1604/unifi-5.8.30.sh  && chmod +x unifi-5.8.30.sh
    sudo ./unifi-5.8.30.sh
  8. Once the script has completed, open a web browser to public IP address to complete the configuration or restore from your backup file.
Senior Member
Posts: 10,589
Registered: ‎08-04-2017
Kudos: 1719
Solutions: 518

Re: Unifi Controller on Azure

[ Edited ]

Hello @MallocArray,

 

Awesome to see that you're using my scripts!

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
New Member
Posts: 1
Registered: ‎10-11-2018

Re: Unifi Controller on Azure

This is great

 

Can anyone advise what commands would be used to upgrade to the latest version? For example 5.9.29

 

Thanks

Emerging Member
Posts: 79
Registered: ‎04-07-2017
Kudos: 16
Solutions: 2

Re: Unifi Controller on Azure

[ Edited ]

@clarion-ccit wrote:

This is great

 

Can anyone advise what commands would be used to upgrade to the latest version? For example 5.9.29

 

Thanks


On Ubuntu, regardless of where it is hosted:

 

sudo apt-get update
sudo apt-get upgrade unifi

Personally, I prefer to patch the OS as well.  This does not upgrade you to the latest version of Ubuntu (i.e. if you're on 16.04, you'll stay on 16.04):

 

sudo apt-get update
sudo apt-get upgrade

 

Senior Member
Posts: 10,589
Registered: ‎08-04-2017
Kudos: 1719
Solutions: 518

Re: Unifi Controller on Azure

[ Edited ]

Hello @clarion-ccit,

 

You can use my easy update script. (Scroll down till you see the easy update banner)

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
Highlighted
Emerging Member
Posts: 79
Registered: ‎04-07-2017
Kudos: 16
Solutions: 2

Re: Unifi Controller on Azure

@AmazedMender16 Thanks, but as I said, I also patch the OS.  I have an alias that I can run from my shell to do that.

Senior Member
Posts: 10,589
Registered: ‎08-04-2017
Kudos: 1719
Solutions: 518

Re: Unifi Controller on Azure

Hello @belvdr,

 

Sorry tagged the wrong user, your commands only work if you have the repository on your machine.

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation/Easy Update Scripts | UniFi-VoIP Installation Scripts
USG-4-PRO • USG
USW-48-500W • USW-24-POE-250W 2x • USW-16-POE-150W • USW-24 • USW-8-150W • USW-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M
UCK-G2 • UCK
New Member
Posts: 4
Registered: ‎10-31-2017

Re: Unifi Controller on Azure

This worked perfectly! Thanks for Sharing!
Reply