How to Install Nginx on Google Cloud Server

office scene 4255945 640
office scene 4255945 640

This post shows students and new users steps to install the Nginx HTTP server on a Google Cloud server running Ubuntu Linux. If you want to run a website online, you’ll need a web server. Nginx is one of the most popular open-source servers today and a great web server to run websites online.

This is the fourth post in this series which can be used as a beginner’s guide to learn how to create a website domain, set up a Google Cloud server with Ubuntu Linux, and install software and packages to build and run a website online.

In this series:

Now that you’ve learned how to create a website domain and set up a Google Cloud server, this post shows you how to install the Nginx HTTP web server.

A web server allows content to be published and served to clients and your audience browsing your website.

In our first post, we mentioned that after you create a domain name, it can’t be used until forwarded or pointed to a server. The second post showed you how to point a domain to a server we created.

At this point, we’re ready to connect to our Google Cloud server and begin installing software and packages that will be used to run a website online.

How to connect to the Google Cloud server

Google Cloud server (Compute Engine) allows users to connect using SSH from the browser window to their virtual machine (VM) instance within the Google Cloud Console

SSH from the browser supports the following:

  • Web browsers
    • The latest version of Google Chrome
    • Firefox
    • Microsoft Edge
    • Microsoft Internet Explorer 11 and later
    • Safari 8 and later. Note that Safari in private browser mode is not supported.
  • Virtual machine configurations
    • All Linux VM images are natively available in Google Cloud.

No additional software or browser extensions are needed. Simply login to Google Cloud Console and go to Menu ==> Compute Engine ==> VM instances.

In the list of virtual machine instances, click SSH in the row of the instance that you want to connect to.

Alternatively, you can open an SSH connection to an instance by clicking its name and SSH from the instance details page.

An SSH terminal window with the Ubuntu Linux instance created in the series’s second post will open.

You should now be able to run commands in Ubuntu Linux created on the Google Cloud server.

How to install Nginx on Ubuntu Linux on Google Cloud Server

Installing Nginx on Ubuntu Linux is no different, whether on Google Cloud or a local VM instance.

Nginx packages are available in Ubuntu default repositories. One can simply download and install the Nginx HTTP server on Ubuntu Linux using the apt-get commands.

A detailed post and help installing Nginx on Ubuntu Linux are below. Click on it to learn more about installing and managing the Nginx HTTP server on Ubuntu Linux.

How to install Nginx on Ubuntu Linux

With the Nginx web server installed, your domain name should now be able to bring up a default Nginx help page when any browses your domain name.

Go and type your domain name in your browser, and you should see an example page similar to the one below:

ubuntu self-signed nginx certs

As you can see, your server hosted on Google Cloud is now resolving your domain name and server content with the Nginx HTTP web server.

We’ll continue to add other servers and software for you to run a functional website online.


This post showed you how to Nginx HTTP web server on Ubuntu Linux in Google Cloud. Please use the comment form below if you find any errors above or have something to add.

Posted by

I love computers; maybe way too much. What I learned I try to share at

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: