Stay organized with collections
Save and categorize content based on your preferences.
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
:
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
.
Go to project selector
-
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
.
Go to project selector
-
Make sure that billing is enabled for your Google Cloud project
.
- Enable the Compute Engine API.
Enable the Compute Engine API
Create a Linux VM instance
-
In the Google Cloud console, go to the
Create an instance
page.
Go to Create an instance
-
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 instance to start. After the 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 with the
roles/compute.instanceAdmin
role. Compute Engine also adds that
user to the
sudo
group.
Connect to the VM instance
Connect to an instance by using the Google Cloud console and completing the
following steps. You're connected to the VM as the user you used to access
the VM instances page.
-
In the Google Cloud console, go to the
VM instances
page.
Go to VM instances
-
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.
Go to VM instances
Click the name of the instance you created.
At the top of the instance's details page, click
Delete
.
Except as otherwise noted, the content of this page is licensed under the
Creative Commons Attribution 4.0 License
, and code samples are licensed under the
Apache 2.0 License
. For details, see the
Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-11 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]