{"id":37224,"date":"2019-06-20T10:00:20","date_gmt":"2019-06-20T17:00:20","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/premier-developer\/?p=37224"},"modified":"2019-06-12T05:12:15","modified_gmt":"2019-06-12T12:12:15","slug":"setting-up-a-cloud-server-to-run-unifi-controller","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/setting-up-a-cloud-server-to-run-unifi-controller\/","title":{"rendered":"Setting up a cloud server to run UniFi Controller"},"content":{"rendered":"<p style=\"margin-top: 0in;\"><span style=\"font-size: 12.5pt; font-family: 'Segoe UI',sans-serif; color: #333333;\">Sr. Application Development Manager\u00a0<a href=\"https:\/\/www.linkedin.com\/in\/chris-tjoumas-pmp-9344558\/\">Chris Tjoumas<\/a>\u00a0outlines a process for using Azure virtual machines to configure a UniFi controller in your home network.<\/span><\/p>\n<hr \/>\n<p>If you are using the UniFi controller to setup a home network and you want to setup guest access and direct them to a guest portal, you will need the UniFi controller to be running 24&#215;7. If you don&#8217;t want to keep your home machine constantly running (or at least during the day, every day), you can setup a virtual machine in Azure to create a UniFi cloud controller.<\/p>\n<p>To run the UniFi Controller software on Azure, follow these steps:<\/p>\n<ol>\n<li>Create new Virtual Machine (VM) resource<\/li>\n<li>Give the VM a name, region, resource group, Windows Server 2016 Datacenter image, and choose the smallest size (I chose standard B1s). Finally, enter a username and password for the VM admin.\n<ol style=\"list-style-type: lower-alpha;\">\n<li>Even though this is a relatively inexpensive VM, you should also consider setting up a schedule for this VM so that it shuts down at night and starts up in the morning, unless you plan on having guests join your network at the wee hours of the morning.<\/li>\n<\/ol>\n<\/li>\n<li>Click the &#8220;Next&#8221; button to select the disks, and select the Standard HDD option.<\/li>\n<li>Leave the other settings at their default values, then click the &#8220;Review and create&#8221; button. Once validation passes, click the &#8220;Create&#8221; button.<\/li>\n<li>Once the VM is provisioned, you&#8217;ll see the following screen (note that all of the networking was created for you):<\/li>\n<\/ol>\n<p style=\"padding-left: 30px;\"><img decoding=\"async\" class=\"alignnone wp-image-37225\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/delete-cancel-1-1-redeploy-refresh-e-your-deplo.png\" alt=\"Deployment complete\" width=\"1007\" height=\"598\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/delete-cancel-1-1-redeploy-refresh-e-your-deplo.png 1007w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/delete-cancel-1-1-redeploy-refresh-e-your-deplo-300x178.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/delete-cancel-1-1-redeploy-refresh-e-your-deplo-768x456.png 768w\" sizes=\"(max-width: 1007px) 100vw, 1007px\" \/><\/p>\n<p>Next, click\u00a0the &#8220;Go to resource&#8221; button. When you see the overview section, take note of the Public IP Address and write this down for later:<\/p>\n<p style=\"padding-left: 30px;\"><img decoding=\"async\" width=\"1114\" height=\"270\" class=\"wp-image-37226\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/connect-start-resource-group-change-status-lo.png\" alt=\"Connect Start Resource group (change) Status Location Subscription (change) Subscription ID Tags (change) e Restart : uniFi . Running East US stop Capture Delete Refresh : Visual Studio Enterprise : Click here to add tags Computer name Operating system Size Public IP address Virtual network\/subnet DNS name : uniFiControIler : Windows Standard 31s (1 vcpus, 1 GE memonj) : uniFi-vnet\/default : Configure \" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/connect-start-resource-group-change-status-lo.png 1114w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/connect-start-resource-group-change-status-lo-300x73.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/connect-start-resource-group-change-status-lo-768x186.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/connect-start-resource-group-change-status-lo-1024x248.png 1024w\" sizes=\"(max-width: 1114px) 100vw, 1114px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Now we need to set the public IP address of the server to be static:<\/p>\n<ol>\n<li>Click on &#8220;Networking&#8221; on the left side of the portal<\/li>\n<li>In the Networking view, click the Public IP address:\n<img decoding=\"async\" width=\"821\" height=\"130\" class=\"wp-image-37227\" style=\"font-size: 1rem;\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/attach-network-interface-detach-network-interface.png\" alt=\"Attach network interface Detach network interface Network Interface: unificontroller323 Effective security rules Virtual network\/subnet: uniFi-vnet\/default Public 19: apology Private 19: 10.0.1.5 Accelerated networking: Disabled \" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/attach-network-interface-detach-network-interface.png 821w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/attach-network-interface-detach-network-interface-300x48.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/attach-network-interface-detach-network-interface-768x122.png 768w\" sizes=\"(max-width: 821px) 100vw, 821px\" \/><\/li>\n<li>Set the option for Assignment to Static and click &#8220;Save&#8221;.<\/li>\n<\/ol>\n<p>Next, we need to set the local IP address of the server to be static:<\/p>\n<ol>\n<li>Go back to Networking (the top breadcrumb menu will take you there), then click on the Network interface:\n<img decoding=\"async\" width=\"838\" height=\"136\" class=\"wp-image-37228\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/attach-network-interface-detach-network-interface-1.png\" alt=\"Attach network interface Detach network interface Network Interface: unificontroller323 Effective security rules Virtual network\/subnet: uniFi-vnet\/default Public 19: Topology Private 19: 10.0.1.5 Accelerated networking: Disabled \" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/attach-network-interface-detach-network-interface-1.png 838w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/attach-network-interface-detach-network-interface-1-300x49.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/attach-network-interface-detach-network-interface-1-768x125.png 768w\" sizes=\"(max-width: 838px) 100vw, 838px\" \/><\/li>\n<li>Click on IP configurations on the left, then click on &#8216;ipconfig1&#8217;.<\/li>\n<li>Set the Assignment to Static and click Save<\/li>\n<\/ol>\n<p>Finally, we need to open the ports necessary to run the controller. In order to do this, we&#8217;ll need to add inbound port rules:<\/p>\n<ol>\n<li>Go back to Networking, and then click on the &#8220;Add inbound port rule&#8221; button:\n<img decoding=\"async\" width=\"1407\" height=\"261\" class=\"wp-image-37229\" style=\"font-size: 1rem;\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/attach-network-interface-detach-network-interface-2.png\" alt=\"Attach network interface Detach network interface Network Interface: unificontroller323 Effective security rules Virtual network\/subnet: uniFi-vnet\/default Public 19: Topology Private 19: 10.0.1.5 Accelerated networking: Disabled Inbound port rules Outbound port rules Application security groups Load balancing Network security group UniFiController-nsg (attached to network interface: unificontroller323) Impacts O subnets, 1 network interfaces PRIORITY Add inbound port rule SOURCE DESTINATION \" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/attach-network-interface-detach-network-interface-2.png 1407w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/attach-network-interface-detach-network-interface-2-300x56.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/attach-network-interface-detach-network-interface-2-768x142.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/attach-network-interface-detach-network-interface-2-1024x190.png 1024w\" sizes=\"(max-width: 1407px) 100vw, 1407px\" \/><\/li>\n<li>We are going to allow RDP access in order for you to be able to remote in and configure the controller \/ VM. You can leave the Source IP as Any, but to add the security of only allowing IPs from your home, put in your IP address. RDP requires port 3389 to be open and uses TCP (you may also use a CIDR block to allow any IPs in your home \u2013 check out my <a href=\"https:\/\/blogs.msdn.microsoft.com\/premier_developer\/2018\/10\/22\/understanding-cidr-notation-when-designing-azure-virtual-networks-and-subnets\/\">CIDR notation blog post<\/a> for more information):\n<img decoding=\"async\" width=\"590\" height=\"727\" class=\"wp-image-37230\" style=\"font-size: 1rem;\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/add-inbound-security-rule-uni-basic-source-o.png\" alt=\"Add inbound security rule uni Basic * Source O IP Addresses * Source ID addresses\/ClDR ranges 0 * Source port ranges O * Destination O * Destination port ranges 0 x 3389 * protocol * Action Allow * Priority O * Name Port 3389 Description UDP Deny \" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/add-inbound-security-rule-uni-basic-source-o.png 590w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/add-inbound-security-rule-uni-basic-source-o-243x300.png 243w\" sizes=\"(max-width: 590px) 100vw, 590px\" \/><\/li>\n<li>Repeat this last step and add the following inbound security rules as shown here (pay attention to the Priority):\n(<em>Note: when configuring port 8443, you can set the Source IP to your home IP for added security, as this is the port which allows access to the configuration web page of the controller<\/em>)\n<img decoding=\"async\" width=\"1401\" height=\"492\" class=\"wp-image-37231\" style=\"font-size: 1rem;\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/priority-120-130-150-65000-65001-65500-inbo.png\" alt=\"PRIORITY 120 130 150 65000 65001 65500 Inbound port rules Outbound port rules Application security groups Load balancing Network security group UniFiController-nsg (attached to network interface: unificontroller323) Impacts O subnets, 1 network interfaces Port 3389 Port 8080 Port 8843 Port 8880 Port 3478 Port 6789 port 8443 3389 8843 8880 3478 6789 TCP TCP TCP TCP TCP UDP TCP SOURCE VirtualNetwork AzureLoadBalancer DESTINATION VirtualNetwork AllowVnetlnBound AllowAzureLoad8alancerlnBound DenyAlllnBound Add inbound port rule e Allow e Allow e Allow e Allow e Allow e Allow e Allow e Allow e Allow O Deny \" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/priority-120-130-150-65000-65001-65500-inbo.png 1401w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/priority-120-130-150-65000-65001-65500-inbo-300x105.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/priority-120-130-150-65000-65001-65500-inbo-768x270.png 768w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2019\/06\/priority-120-130-150-65000-65001-65500-inbo-1024x360.png 1024w\" sizes=\"(max-width: 1401px) 100vw, 1401px\" \/><\/li>\n<\/ol>\n<p>After the networking has been configured, go back to the VM and click the &#8220;Connect&#8221; button. This will download an RDP file configured to remote into the virtual machine. Launch this RDP file, and connect using the username\/password you configured when the VM was created. Once you have established a connection, perform the following steps inside the VM:<\/p>\n<ol>\n<li>install the Chrome browser as the UniFi controller works best in this browser<\/li>\n<li>Download the latest version of the UniFi SDN Controller for Windows: <a href=\"https:\/\/www.ui.com\/download\/unifi\/\">https:\/\/www.ui.com\/download\/unifi\/<\/a><\/li>\n<li>Download the 64-bit version of Java 8: <a href=\"https:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/jre8-downloads-2133155.html\">https:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/jre8-downloads-2133155.html<\/a><\/li>\n<li>Install Java, accepting all of the default options<\/li>\n<li>Install the UniFi Controller and run the Controller after installation<\/li>\n<li>When prompted, check both boxes to allow Java to open the required ports<\/li>\n<li>When the controller is started, click the &#8220;Launch a Browser to Manage the Network&#8221; button. Make sure to run this in Chrome as IE is not fully supported<\/li>\n<li>Select your timezone and click Next.<\/li>\n<li>We won&#8217;t configure devices initially; click Next and then click Skip on the next WiFi screen<\/li>\n<li>Enter your admin credentials and click Next<\/li>\n<li>Review configuration details and click Next<\/li>\n<li>You can link the cloud controller to your ubnt.com account if you have one, otherwise you can skip this<\/li>\n<li>If you are presented at the login screen, log back in to the controller. Click the Settings icon on the bottom left of the screen<\/li>\n<\/ol>\n<p>You must reset the AP to clear any previous configuration. After you reset it, you will issue a set-inform command with the IP address of your UniFi controller in Azure. This will tell your AP that the controller is located at this IP address, and it will set itself as visible to your controller in order to be adopted.<\/p>\n<ol>\n<li>SSH into the AP (default password is ubnt)<\/li>\n<li>Execute the reset command: syswrapper.sh restore-default<\/li>\n<li>Execute the set-inform command with the IP address of your Unifi controller in Azure: set-inform http:\/\/&lt;your VM DNS name&gt;:8080\/inform.\u00a0Note, you can find the DNS name on the overview of your VM in Azure<\/li>\n<\/ol>\n<p>Once you go back to your controller in your Azure VM, click on your Devices menu on the left. You should now see your Access Point set to Ready to Adopt. Once you adopt your device, you&#8217;re all set! Through your controller, which you can also run anywhere by going to your controller via your DNS in a web browser (<a href=\"https:\/\/unificontroller839.eastus.cloudapp.azure.com:8443\/\">https:\/\/your DNS name:8443<\/a>), you can setup your guest network and configure your AP. And best of all, now that you have your controller running in Azure, your guest network will remain up and running as long as your VM is running. Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, we&#8217;ll explore how to setup an Azure virtual machine to act as a UniFi controller in the cloud, enabling 24&#215;7 guest access without the overhead of running a physical machine continuously in your home.<\/p>\n","protected":false},"author":582,"featured_media":37293,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[25],"tags":[24,3,7125],"class_list":["post-37224","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure","tag-azure","tag-team","tag-virtual-machines"],"acf":[],"blog_post_summary":"<p>In this post, we&#8217;ll explore how to setup an Azure virtual machine to act as a UniFi controller in the cloud, enabling 24&#215;7 guest access without the overhead of running a physical machine continuously in your home.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/37224","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/582"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=37224"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/37224\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/37293"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=37224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=37224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=37224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}