Create a Linux VM instance in Compute Engine
Learn how to create a Linux virtual machine (VM) instance in Compute Engine using the Google Cloud console.
To follow step-by-step guidance for this task directly in the Google Cloud console, click Guide me:
Before you begin
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
- Enable the Compute Engine API.
Create a Linux VM instance
- In the Google Cloud console, go to the Create an instance page.
- In the Boot disk section, click Change to begin configuring your boot disk.
- On the Public images tab, choose Ubuntu from the Operating system list.
- Choose Ubuntu 20.04 LTS from the Version list.
- Click Select.
- In the Firewall section, select Allow HTTP traffic.
- To create the VM, click Create.
Allow a short period of time for the VM instance to start. After the VM instance is ready, it's listed on the VM instances page with a green status icon.
Compute Engine grants the user who creates the VM instance with the
roles/compute.instanceAdmin
role. Compute Engine also adds that
user to the sudo
group.
Connect to the VM instance
Connect to a VM instance by using the Google Cloud console and completing the following steps. You're connected to the VM instance as the user you used to access the VM instances page.
- In the Google Cloud console, go to the VM instances page.
- In the list of virtual machine instances, click SSH in the row of the instance that you want to connect to.
Clean up
To avoid incurring charges to your Google Cloud account for the resources used on this page, follow these steps.
In the Google Cloud console, go to the VM instances page.
Select the row containing the VM instance that you've created in this tutorial.
Click
Delete, and then click Delete to confirm.
What's next
- Work through a tutorial to set up a basic web server on your new instance.
- Work through a getting started tutorial in the Google Cloud console.
- Learn how to create and manage virtual machine instances using the gcloud CLI command-line tool and API.
- Learn more about the Linux images available on Compute Engine.
- Learn how to transfer your files to your instance.