Set up a Datalab VM instance
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 Cloud project. Learn how to check if billing is enabled on a project.
-
Enable the Google Compute Engine and Cloud Source Repositories APIs.
- Install and initialize the Google Cloud CLI.
-
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 Cloud project. Learn how to check if billing is enabled on a project.
-
Enable the Google Compute Engine and Cloud Source Repositories APIs.
- Install and initialize the Google Cloud CLI.
Steps to set up and open Cloud Datalab
From a terminal window on your local machine:
Update your Google Cloud CLI components:
gcloud components update
If you installed the Google Cloud CLI throughapt
oryum
, use those package managers to update the components:sudo apt update && sudo apt upgrade google-cloud-sdk
sudo yum upgrade google-cloud-sdk
Install the
datalab
component for the Google Cloud CLI:gcloud components install datalab
If you installed the Google Cloud CLI throughapt
oryum
, use those package managers to update the components:sudo apt update && sudo apt install google-cloud-sdk-datalab
sudo yum install google-cloud-sdk-datalab
Create a Cloud Datalab instance. The name of the instance must start with a lowercase letter, followed by up to 62 lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
datalab create datalab-instance-name
If the command returns an error, re-run the command with the following debug flag to help diagnose the problem:datalab create --verbosity=debug datalab-instance-name
.Open the Cloud Datalab home page in your browser.
http://localhost:8081
Clean up
To avoid incurring charges to your Google Cloud account for the resources used on this page, follow these steps.
- You incur charges from the time of creation to the time
of deletion of the Cloud Datalab VM instance (see
Cloud Datalab Pricing). You are
also charged for the Persistent Disk where notebooks are stored. The Persistent
Disk remains after the deletion of the VM until you delete it.
The following command deletes both the VM instance and its Persistent Disk.
datalab delete --delete-disk instance-name
Other cleanup tasks. Additional resources are created by the
datalab create
command, and will be reused by other Cloud Datalab instances that you create. You can run the following commands to delete the additional resources listed below if you do not expect to create additional Cloud Datalab instances.- Delete the
datalab-network-allow-ssh
firewall rule, which allows SSH connections to your Cloud Datalab instances:gcloud compute firewall-rules delete datalab-network-allow-ssh
- Delete the
datalab-network
Virtual Private Cloud (VPC) network, to which Datalab instances are connected by default.gcloud compute networks delete datalab-network
- Delete the
datalab-notebooks
Cloud Source Repository, which is set up for you to store your notebooks (see Working with notebooks if you wish to backup notebooks before deleting the repo).gcloud source repos delete datalab-notebooks
- Delete the
- Delete the
What's next
- Browse the
/datalab/docs/intro
Cloud Datalab notebook folder to become familiar with the capabilities of Cloud Datalab. You will find tutorials and samples for using Google Cloud Platform services and for performing common data analysis tasks. - You can view the
datalab
server VM logs with the Cloud Platform Console Logs Explorer. - Read Cloud Datalab How-to Guides.
- Learn more about the options available in the
datalab
command line tool by runningdatalab --help
. - Learn about Using Datalab in a team environment.