Deploying a web application on a Google Cloud Platform (GCP) Virtual Machine (VM) instance is a powerful way to host your web app with scalable infrastructure. In this guide, we’ll walk through the steps to get your GCP VM instance up and running.
Prerequisites:
- Google Cloud Platform Account: Ensure you have a GCP account. If not, you can sign up and receive $300 in free credits.
Step-by-Step Guide
1. Create a Google Cloud Project
1) Go to the Google Cloud Console.
2) Click on the project drop-down menu at the top and select “New Project”.
3) Enter a project name and click “Create”.
4) Select your project
2. Create VM instance
1) Select “Compute Engine” from quick access or from the side bar.
2) You will be asked to Enable “Compute Engine API”, Enable it.
3) After enabling the API, You will be taken to Compute instance page. Click Crate Instance at top of the page.
4) Now put the name, select region and zone, select machine configuration, select VM provisioning model.
5) Change boot disk and select Ubuntu OS with latest LTS version instead of Debian and change disk size to 20GB.
6) Under firewall section allow HTTP and HTTPS traffic.
7) After all the settings done click “Create”.
3. SSH into VM instance and update it
Now you can SSH into VM instance using the SSH button.
use this command to update.
sudo apt update
Learn More About Ubuntu here
You got yourself a running VM instance on GCP.
You can close the SSH by using command exit.
Conclusion
Deploying an application on a Google Cloud Platform VM instance provides you with full control over your environment and scalability options. By following these steps, you’ll have a robust setup ready to handle your web traffic.
Feel free to customize the setup according to your specific needs and preferences!