Before you begin

  1. 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.
  2. In the Google Cloud Console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Cloud project. Learn how to confirm that billing is enabled for your project.

  4. Enable the Google Compute Engine and Cloud Source Repositories APIs.

    Enable the APIs

  5. Install and initialize the Cloud SDK.

Steps to set up and open Cloud Datalab

From a terminal window on your local machine:

  1. Update your gcloud command-line tool components:

    gcloud components update
    If you installed the gcloud command-line tool through apt or yum, use those package managers to update the components:
    sudo apt update && sudo apt upgrade google-cloud-sdk
    sudo yum upgrade google-cloud-sdk

  2. Install the datalab component for the gcloud command-line tool:

    gcloud components install datalab
    If you installed the gcloud command-line tool through apt or yum, 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

  3. 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.

  4. Open the Cloud Datalab home page in your browser.


Clean up

To avoid incurring charges to your Google Cloud account for the resources used in this page, follow these steps.

  1. 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
  2. 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

What's next

  1. 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.
  2. You can view the datalab server VM logs with the Cloud Platform Console logs viewer.
  3. Read Cloud Datalab How-to Guides.
  4. Learn more about the options available in the datalab command line tool by running datalab --help.
  5. Learn about Using Datalab in a team environment.