How to Install MySQL or MariaDB on Google Cloud Server
Installing MySQL or MariaDB on a Google Cloud server gives your website a safe place to store information like user accounts and WordPress posts. Both options are free database systems that run on Ubuntu Linux and keep your site’s data organized behind the scenes.
MariaDB works just like MySQL, so you can pick whichever one you prefer for your project. This setup takes about 15 minutes and gets your cloud server ready to host a live website.
Install MySQL or MariaDB on your Ubuntu Google Cloud server by connecting via SSH and using apt-get commands. Update package lists with sudo apt-get update, then install your chosen database with sudo apt-get install mysql-server or sudo apt-get install mariadb-server.
How to connect to the Google Cloud server
Connecting to Your Google Cloud Server. Connecting to your Google Cloud server happens through the SSH (Secure Shell network protocol) tool built right into your web browser via the Google Cloud Console. This tool works with major browsers like Chrome, Firefox, Edge, and Safari, letting you access your server without installing extra software.
Browser-based SSH requires a modern browser like Chrome, Firefox, Edge, or Safari 8 and later. Note that Safari will not work in private browsing mode.
- Web browsers
- The latest version of Google Chrome
- Firefox
- Microsoft Edge
- Microsoft Internet Explorer 11 and later
- Safari 8 and later. Note that Safari is not supported in private browser mode.
- Virtual machine configurations
- All Linux VM images are natively available in Google Cloud.
No additional software or browser extensions are needed. Log in to the Google Cloud Console and navigate to Menu Compute Engine VM instances.
In the list of virtual machine instances, click SSH in the row of the instance you want to connect to.

Alternatively, open an SSH connection to an instance by clicking its name and selecting SSH from the instance details page.
An SSH terminal window with the Ubuntu Linux instance created in the series's second post will open.
Run commands directly inside the Ubuntu Linux environment created on the Google Cloud server.

How to install a database server on Google Cloud Servers
Installing a database server, such as MySQL or MariaDB, on your Google Cloud server relies on Ubuntu's package manager (a collection of tools for installing software). Once set up, your website's content lives in the database, which pairs with your domain name to make the site function correctly.
How to install MySQL or MariaDB on Ubuntu Linux
Content stores inside a database once the database server is installed and your domain name points to your Google Cloud server.
A website uses a web server, PHP language, and database server to function online. These three components connect their tasks: the web server handles visitor requests, PHP processes dynamic content, and the database stores website information.
Configuration of servers and packages starts now to get the website running.
Check out previous posts to catch up on earlier steps.
Conclusion:
With the database installed, your Google Cloud server is ready to handle real site traffic. Following the steps outlined in this guide, you can manage your database needs and keep content secure. Here are the key takeaways:
- Establishing a web and database server is essential for running dynamic websites and CMS platforms.
- Google Cloud offers user-friendly SSH access to connect to your virtual machines.
- MySQL or MariaDB can be installed easily using Ubuntu's default repositories and
apt-getcommands. - Each step in this series builds on the previous one, culminating in a fully operational website.
Watch for the next post, where we dive deeper into configuring servers and finalizing the website setup!
Was this guide helpful?
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.
No comments yet — be the first to share your thoughts!