Create your own Ubuntu Server on Google Cloud Platform

Chưa phân loại
Google Cloud Platform offers a number of services ranging from App Engine, fully managed Kubernetes, Database as a Service, Function as a Service, Object store and much more. It is easy enough to get overwhelmed by all the functionalities, each as attractive as other. The Google Cloud Platform dashboard, in my opinion, doesn’t make it any easier for the user, either!

Sometimes, all we need is a simple VM. Despite the uprising of containers, VMs are still useful and simple. You don’t have to worry about giving your application permissions for a different Database service, an object store service etc. Everything from compute to storage can be contained within a single (scalable) VM.

In this post, let’s dive into how one can spin up a Ubuntu server in Google’s Cloud Platform.

Google Compute Engine (GCE)

GCE is the product that actually lets you configure and deploy virtual machines on Google’s infrastructure. Everything from the amount of resources to the networking capabilities, SSH-keys and Operating system are selected herein.

Login to your Google Cloud Platform dashboard, and search for GCE. At once Compute Engine will show up in the results, click on it.

Here’s an overview of Compute Engine:

As you can see, the side menu has a lot of options for managing your VMs and monitoring them. We will stick to VM instances for now. Since this lets us create a single VM. If you wish to create a group of them “Instance groups” might serve you better.

Let’s start by clicking on Create, as shown in the screenshot above.

A VM template with all the default values provided by Compute Engine will appear. Let’s configure a few of the defauls. I’ll leave the CPU to 1 vCPU and memory to 3.75 GB as those values are good enough for a demo. If you want more/less resources for optimal price and performance, feel free to tweak these parameters.

First thing I will tweak is the boot disk. We want Ubuntu, so, under boot disk, click on Change and select Ubuntu 18.04 LTS. This disk will have the OS installed and the remaining space is what you will use for your application, packages, etc. (unless you are adding extra block storage). So if you want more storage than the default 10GB, make sure to increase the size, as shown below.

Moreover, for better performance you can select SSD persistent disk. This is a significant improvement over standard persistent disk. Once the boot disk is selected to be Ubuntu, we can just create the VM and have a Ubuntu server installed in the cloud for us.

However, let’s configure, for convenience sake, Firewall and SSH keys.

If you wish to host an HTTP or HTTPS server, make sure to check the boxes saying “Allow HTTP Traffic” and “Allow HTTPS Traffic”. Most websites would need this, and so would most API servers, reverse proxy servers, etc. As for the Identity and API access parameters are concerned, you can leave that to default.

Now click on “Management, security, disks…” section to access more customization features. Within this dropdown go to Security and you can paste your public ssh key in here. The username within the key will also be created inside the VM. For example, the key


Will create a user named ranvir with sudo access and place the SSH key within this user’s home directory (~/.ssh/authorized_keys) so you can access the VM remotely.

We are almost done. Review the monthly estimated price this VM will cost you as well as the region where it will be spun up, by scrolling all the way up again. Regions are a subjective, but important parameter. For someone trying to create a VPN, a VPN several time zones away is better suited. On the other hand, if you require lower latencies, you need to select a region nearest to you.

Then click on create and you have your Ubuntu VM up and running!

Post Configuration

In order to make sure that you can ssh into the VM reliably as well as point domain names to this VM, you would need a static public IP address. If you view the Compute Engine dashboard, you will see the status of your VM along with its external (public) IP.

But if you click on the VM’s name (instance-1 in my case) then you will notice that the IP is, in fact, ephemeral.

This means trouble, especially if you are using external domain name servers to point your FQDN towards this IP address. To change this to static, click on Edit, from the top menu. Scroll back to network interfaces (nic0, in our case) and edit it.

Click on Ephemeral under the External IP and select Create IP address.

It will open up a dialogue box asking you for a name to give to this new static IP.  Give it a reasonable name and click Reserve. You will notice that the external IP of the VM has indeed changed and, hopefully, for the last time.

You can now try to ssh into this VM via its external IP. Remember the username that was associated with your public SSH key? Just use that along with the static IP you obtain, like in my case it would be:

$ ssh ranvir@

Your username and IP would be very different from mine, use those instead.

Next steps

When it comes to computation, automation is the name of the game. VMs are often created as a disposable entity in the cloud, especially if you just want to use them for a few hours of testing, or running batch processes, etc.

Now that you know how to create a VM using the GUI, try automating the process using the gcloud CLI or the REST API. Whatever actions you perform on the Compute Engine GUI, an equivalent HTTP request or gcloud command is available in the bottom of the page.

Use them to automate the tedious process of spinning up VMs. This will help you save an enormous amount of time.

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

Install Nextcloud on FreeNAS

Nextcloud is one of the most popular open source, self-hosted cloud storage alternative. It offers a visually appealing...

Fedora Versus CentOS

Both members of the same family of RPM-based Linux distributions, CentOS and Fedora share many similarities, but they are...

Hướng dẫn kiểm tra Log Remote Desktop trên Windows

Có nhiều lúc chúng ta muốn thống kê các sự kiện đăng nhập sai, đúng. Hay đơn giản chỉ muốn...
Bài Viết

Bài Viết Mới Cập Nhật

Check proxy trên trang nào chuẩn nhất❓

Thuê Proxy chạy Google Ads / Cần chú ý gì khi chọn proxy và email chạy G.G ads?

Thuê proxy 4G ở đâu uy tín, giá rẻ, chất lượng?

Vì sao cần thuê proxy xoay? Địa chỉ cung cấp proxy xoay uy tín

Thuê proxy v6 kéo view Youtube ở đâu uy tín, chất lượng?