book collections email follower instructable user
Picture of Unifi Controller on Google Cloud Platform (GCP)

Ubiquity's Unifi Controller allows for web management of their Unifi products including wireless access points, routers, and switches. They have an excellent guide for setting up the controller on Amazon AWS using the free tier that gives a free VM for 12 months. Once the year is up, you must pay to continue using the VM.

Install a UniFi Cloud Controller on Amazon Web Services

Google Cloud Platform (GCP) also offers a free tier with a free micro VM forever with similar specs to the Amazon offer. The purpose of this guide is to document the steps to setup a Unifi Controller in GCP.

Note: Another user, Petri, has written an excellent guide plus a script that sets up additional features such as Let Encrypt certificates, Fail2Ban limits, and general maintenance. Check it out to supplement this instructable:

Step 1: Register/Create Google Cloud Platform Account

Picture of Register/Create Google Cloud Platform Account
  1. Navigate to: and click the "Try Free" button to begin registering for an account
  2. Login with your account at:
  3. Select the project you wish utilize for the Unifi Controller. If setting up a free account, you will have "My first project" selected.
    1. This can be renamed by going to Menu>IAM & admin>Settings and changing the Project name
RatzaiD made it!6 months ago
Thanks for the detailed instructions. It went flawlessly. I've changed all the devices from Meraki to Ubiquity due to the fact that Meraki has a weird way of trying to rip ppl off by averaging the license duration between owned devices. I had an AP (1 year license) and a switch (3 years license). After 1 year it started to warn me and after another 6 months everything stopped working. The AP was deleted hoping I will still have the remaining time to use the switch; it wasn't the case. They insisted the above licensing is only good for 18 months in total. Their maths beats me so I gave up and decided to scrap all and forget about Meraki forever.
dreh1510 months ago
Great stuff. The Petri script still has me confused. I downloaded the GoogleCloudShellCommands-Unifi.txt file and changed things like some-unique-name, dns name, etc. And, can open a browser can got the Controller to open, but I'm still getting the certificate problem (had to create an exception in firefox) and clicking the lock shows not secure. Do I have to run the Petri script again? And, do I do that just from the GC command line? (When I ran the script before doing all the other work I had a bunch of systemctl errors. When I ran the 'gcloud compute instances create unifi-controller \' etc. command, it did complete without error. So, how do I get rid of the certificate problem?

Also, after importing my old local controller settings, it does show the APs but they are all disconnected. Thanks so much.
MallocArray (author)  dreh1510 months ago
Here is the direct link for the Petri script:
Take note of Step 5 about setting up the controller. There are some settings to change on the new controller after you restore it and then you make the same changes to your current controller so it will tell your devices to go to the new IP.

As far as the certificate not working, there are some logs that can be reviewed, or try posting with that specific question on his site. I just deployed a new VM for my controller in the past 2 weeks and my certificate didn't work either. But I use the site to typically access mine so I'm not that concerned about it. But I should find out what it causing it.
dreh15 MallocArray10 months ago
I made the changes to the new & old controller so that seems fine now. Can you tell me if I admin other Unifi APs not on my LAN should the VM controller see those APs at the site they are on, or only when I am on the LAN where those APs reside?

I also was going to try CertBot on my own but wasn't sure of the values to give it for "I'm using" (see screenshot). I chose Ubuntu other since I'm using the 16.04 you recommended.
Screen Shot 2018-11-06 at 12.04.49 PM.png
dreh15 dreh1510 months ago
To answer one of my own questions, the script will run every time the VM is stopped & then restarted. I did that and still couldn't get a certificate. Had several chats with Petri. He said he thought it might be because your command line stuff calls to install Ubuntu while his script has only been tested with Debian. He suggested creating a new VM following his instructions which creates a Debian VM. Indeed, doing that, the certificate is installed and works. Hope this helps you & any other readers here.
JS128 made it!11 months ago

Great instruction, now I can manage my home network from anywhere! Many thanks MallocArray!

Screenshot 2018-10-16 at 22.08.00.png
TroyV1011 months ago

Hi. I followed this and it is excellent. Thank you. What is the best way to upgrade the controller software?

MallocArray (author)  TroyV1011 months ago

The easiest way is to use some scripts that another Unifi user maintains that can be found here:

Just follow the instructions on the page and you are good to go.

Hi there! Great article. I followed it almost to a T (just named things a little differently). However, I cant connect to the controller from a webpage. I get a "Connection refused" error. Also, according to port 8443 is closed (along with all my other "open" ports except 22). Any thoughts?

MallocArray (author)  kalidreamer13371 year ago

Are you using Ubuntu 18.04? If so, the version of MongoDB that comes with it is not supported with current Unifi versions. The Unifi forums have workarounds for downgrading Mongo.
If you are using an earlier version and port 8443 is not open, double check the firewall rules and also check the status of the unifi service with this command

service unifi status

You can also check the last several lines (30 in this case) of the Unifi server logs to see if it tells you if it can't start

sudo tail /var/log/unifi/server.log -n30

TheCoose made it!1 year ago

Fantastic tutorial. Author was very helpful as well!

Nnyan1 year ago

At least my instances every time I reboot them I get a new IP address.

MallocArray (author)  Nnyan1 year ago

I wasn't experiencing that with a simple reboot of my instance and I even stopped the instance a few times and kept the same IP, but I did get a new one in the last 4 days. I think it is related to reboots for the Spectre/Meltdown patches.

I added section 6 to Step 2 which covers creating a Static IP for your instance so it won't change after that.