Skip to content
Follow
Ubuntu Linux

How to Install LEMP on Google Cloud Server

Richard
Written by
Richard
Dec 2, 2021 Updated Aug 13, 2026 4 min read
How to Enable or Disable Microsoft Defender Cloud Protection
How to Enable or Disable Microsoft Defender Cloud Protection

A LEMP stack is a bundle of four open-source programs—Linux, Nginx, MySQL, and PHP—that work together to run dynamic websites like WordPress on a virtual server. Installing a LEMP stack on a Google Cloud server gives you a reliable, cloud-hosted platform to build and host your own websites or web applications.

⚡ Quick Answer

Connect to your Google Cloud server via SSH. Install Nginx, then PHP, and finally MySQL or MariaDB using apt commands. This completes the LEMP stack installation.

This setup process works on a Google Cloud virtual machine running Ubuntu Linux version 22.04 or 24.04. You will install each part step by step, starting with the Nginx web server, followed by the MySQL database, and finishing with PHP.

Now that you’ve learned how to create a website domain, set up a Google Cloud server, and installed Apache, Nginx, PHP, MySQL, or MariaDB, you can continue below to tie all together with any platform that uses the LEMP stack.

As covered earlier in this series, web servers make your site’s content accessible to anyone browsing the internet. A PHP or server-side scripting language allows for a dynamic and more functional website. A database server allows you to store your website content efficiently.

Other software and packages may also be needed to enhance the functionality of a website. Below, we’ll show you how to install these tools with LEMP-based websites and applications.

In our first post, we also mentioned that after creating a domain name, it can’t be used until it is forwarded or pointed to a server. The second post showed you how to point a domain to a server we created. Then we showed you how to install software and packages to help us run a website online.

We're ready to connect to our Google Cloud server and install LEMP by tying the software and packages installed in our previous posts.

How to connect to Google Cloud servers

Google Cloud Compute Engine lets you connect directly to a virtual machine (VM) instance using an in-browser terminal. 

SSH from the browser supports several web browsers:

  • 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. Log in 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.

Establish SSH connection to Google Cloud Ubuntu server instance
establish ssh connection to vm instances

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.

Connect to Google Cloud instance host for LEMP installation
connect to google cloud instance host

How to install the LEMP stack on Google Cloud Servers

Installing and managing the LEMP stack on Ubuntu Linux is no different, whether on Google Cloud servers or a local VM instance.

All the previous posts above are related to installing LEMP, except for installing Apache. LEMP is Linux (Ubuntu), Engine-x, MySQL or MariaDB, and PHP.

Once you've installed all required packages, you should be able to access the LEMP stack from your browser by browsing to the server hostname or IP address.

Below is a detailed post and help installing the LEMP stack on Ubuntu Linux. Use this link to learn more about LEMP.

How to install LEMP on Ubuntu Linux

That should do it!

Conclusion:

Installing the LEMP stack on Google Cloud servers with Ubuntu Linux empowers you to build powerful websites and applications. Here are the key takeaways:

  • LEMP stands for Linux, Nginx (Engine-x), MySQL/MariaDB, and PHP, a widely used stack for modern web development.
  • Properly understanding the components—web server, server-side scripting, and database management—is essential for dynamic content delivery.
  • Following our series ensures a structured approach to creating a domain, setting up Google Cloud servers, and installing the necessary software.
  • Having completed the installation, you can now effectively host and manage LEMP-based websites.
  • Explore additional tools and packages to further enhance your site's capabilities beyond the basic LEMP installation.

By leveraging the power of the LEMP stack, you're well on your way to building robust online presences!

Was this guide helpful?

Tags: #Windows 11
Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

📚 Related Tutorials

How to Install LEMP on Ubuntu Linux
Ubuntu Linux How to Install LEMP on Ubuntu Linux
How to Install PHP on Ubuntu Linux
Ubuntu Linux How to Install PHP on Ubuntu Linux
How to Install Apache on Ubuntu Linux
Ubuntu Linux How to Install Apache on Ubuntu Linux
How to Install Nginx on Ubuntu Linux
Ubuntu Linux How to Install Nginx on Ubuntu Linux

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *