Dataproc Hub is a customized JupyterHubserver. Admins configure and create Dataproc Hub instances that can spawn single-user Managed Service for Apache Spark clusters to host Jupyter and JupyterLab notebook environments (see Use Dataproc Hub).
Launch Notebooks for multiple users. You can create a Managed Service for Apache Spark-enabled Vertex AI Workbench instance or install the Managed Service for Apache Spark JupyterLab plugin on a VM to to serve notebooks to multiple users.
Define a Managed Service for Apache Spark cluster configuration (or use one of the predefined config files).
Set Dataproc Hub instance environment variables.
Create a Dataproc Hub instance.
If you haven't already done so, create a Google Cloud project and a Cloud Storage bucket.
Setting up your project
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
roles/resourcemanager.projectCreator), which contains the
resourcemanager.projects.create permission. Learn how to grant
roles.
Verify that billing is enabled for your Google Cloud project.
Enable the Dataproc, Compute Engine, and Cloud Storage APIs.
Roles required to enable APIs
To enable APIs, you need the serviceusage.services.enable permission. If you
created the project, then you likely already have this permission through the
Owner role (roles/owner). Otherwise, you can get this permission through the
Service Usage Admin role (roles/serviceusage.serviceUsageAdmin).
Learn how to grant roles.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
To initialize the gcloud CLI, run the following command:
gcloud initIn the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
roles/resourcemanager.projectCreator), which contains the
resourcemanager.projects.create permission. Learn how to grant
roles.
Verify that billing is enabled for your Google Cloud project.
Enable the Dataproc, Compute Engine, and Cloud Storage APIs.
Roles required to enable APIs
To enable APIs, you need the serviceusage.services.enable permission. If you
created the project, then you likely already have this permission through the
Owner role (roles/owner). Otherwise, you can get this permission through the
Service Usage Admin role (roles/serviceusage.serviceUsageAdmin).
Learn how to grant roles.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
To initialize the gcloud CLI, run the following command:
gcloud initCreating a Cloud Storage bucket in your project to hold the data used in this tutorial.
key and a value for your label.
In the Replication settings section, click Configure to configure settings for the replication job.
The Configure cross-bucket replication pane appears.
A Dataproc Hub instance creates a cluster from configuration values contained in a YAML cluster configuration file.
Your cluster configuration can specify any feature or component available to Managed Service for Apache Spark clusters (such as machine type, initialization actions, and optional components). The cluster image version must be 1.4.13 or higher. Attempting to spawn a cluster with an image version lower than 1.4.13 will cause an error and fail.
Sample YAML cluster configuration file
clusterName: cluster-name
config:
softwareConfig:
imageVersion: 2.2-ubuntu22
optionalComponents:
- JUPYTER
Each configuration must be saved in Cloud Storage. You can create and save multiple configuration files to give users a choice when they use Dataproc Hub to create their Managed Service for Apache Spark cluster notebook environment.
There are two ways to create a YAML cluster configuration file:
gcloud dataproc clusters export cluster-name \ --destination cluster-config-filename.yaml \ --region region
Copy your local YAML cluster configuration file to your Cloud Storage bucket.
gcloud storage cp cluster-config-filename.yaml gs://bucket-name/
The administrator can set the hub environment variables listed in the table, below, to set attributes of the Managed Service for Apache Spark clusters that will be spawned by hub users.
| Variable | Description | Example |
|---|---|---|
| NOTEBOOKS_LOCATION | Cloud Storage bucket or bucket folder that contains user notebooks. The `gs://` prefix is optional. Default: The Managed Service for Apache Spark staging bucket. | gs://bucket-name/ |
| DATAPROC_CONFIGS | Comma delimited list of strings of the Cloud Storage paths to
YAML cluster config files. The `gs://`
prefix is optional. Default: gs://dataproc-spawner-dist/example-configs/. which contains predefined example-cluster.yaml and example-single-node.yaml.
|
gs://cluster-config-filename.yaml |
| DATAPROC_LOCATIONS_LIST | Zone suffixes in region where the Dataproc Hub instance is located. Users can select one of these zones as the zone where their Managed Service for Apache Spark cluster will be spawned. Default: "b". | b,c,d |
| DATAPROC_DEFAULT_SUBNET | Subnet on which Dataproc Hub instance will spawn Managed Service for Apache Spark clusters. Default: the Dataproc Hub instance subnet. | https://www.googleapis.com/compute/v1/projects/project-id/regions/region/subnetworks/subnet-name |
| DATAPROC_SERVICE_ACCOUNT | Service account that Managed Service for Apache Spark VMs will run as. Default: If not set, the default Managed Service for Apache Spark service account is used. | service-account@project-id.iam.gserviceaccount.com |
| SPAWNER_DEFAULT_URL | Whether to show the Jupyter or JupyterLab UI on spawned Managed Service for Apache Spark clusters by default. Default: "/lab". | `/` or `/lab`, for Jupyter or JupyterLab, respectively. |
| DATAPROC_ALLOW_CUSTOM_CLUSTERS | Whether to allow users to customize their Managed Service for Apache Spark clusters. Default: false. | "true" or "false" |
| DATAPROC_MACHINE_TYPES_LIST | List of machine types that users are allowed to choose for their spawned Managed Service for Apache Spark clusters, if cluster customization (DATAPROC_ALLOW_CUSTOM_CLUSTERS) is enabled. Default: empty (all machine types are allowed). | n1-standard-4,n1-standard-8,e2-standard-4,n1-highcpu-4 |
| NOTEBOOKS_EXAMPLES_LOCATION | Cloud Storage path to notebooks bucket or bucket folder to be downloaded to the spawned Managed Service for Apache Spark cluster when the cluster starts. Default: empty. | gs://bucket-name/ |
There are two ways to set hub environment variables:
When you create a Dataproc Hub instance from the User-Managed Notebooks tab on the Dataproc→Workbench page in the Google Cloud console, you can click the Populate button to open a Populate Dataproc Hub form that allows you to set each environment variable.
Create the file. You can use a text editor to set Dataproc Hub instance environment variables in a local file. Alternatively, you can create the file by running the following command after filling in placeholder values and changing or adding variables and their values.
cat <<EOF > environment-variables-file DATAPROC_CONFIGS=gs://bucket/cluster-config-filename.yaml NOTEBOOKS_LOCATION=gs://bucket/notebooks DATAPROC_LOCATIONS_LIST=b,c EOF
Save the file in Cloud Storage. Copy your local Dataproc Hub instance environment variables file to your Cloud Storage bucket.
gcloud storage cp environment-variable-filename gs://bucket-name/folder-name/
Dataproc Hub includes the following identities with the following abilities:
Each identity requires specific roles or permissions to perform their associated tasks. The table below summarizes IAM roles and permissions required by each identity.
| Identity | Type | Role or permission |
|---|---|---|
| Dataproc Hub administrator | User or Service account | roles/notebooks.admin |
| Dataproc Hub user | User | notebooks.instances.use, dataproc.clusters.use |
| Dataproc Hub | Service account | roles/dataproc.hubAgent |
| Dataproc | Service account | roles/dataproc.worker |
Before you begin: To create a Managed Service for Apache Spark Hub instance
from the Google Cloud console, your user account must have
compute.instances.create permission. Also, the service account of the
instance—the Compute Engine default service account or your
user-specified service account listed in
IAM & admin > Service Accounts (see
Managed Service for Apache Spark VM service account)— must have iam.serviceAccounts.actAs
permission.
Go to the Dataproc→Workbench page in the Google Cloud console, then select the User-Managed Notebooks tab.
If not pre-selected as a filter, click in the Filter box, then select **Environment:Dataproc Hub"".
Click New Notebook→Dataproc Hub.
On the Create a user-managed notebook page, provide the following information:
Environment: Select Dataproc Hub.Select a script to run after creation (optional): You can insert or
browse and select an
initialization action
script or executable to run on the spawned Managed Service for Apache Spark cluster.Populate Dataproc Hub (optional): Click Populate to open a form that
allows you to set each of the hub environment variables (see
Set Dataproc Hub instance environment variables
for a description of each variable). Managed Service for Apache Spark uses
default values for any unset environment variables. As an alternative,
you can set Metadata key:value pairs to set environment variables
(see next item).Metadata:
key and the gs://bucket-name/folder-name/environment-variable-filename
Cloud Storage location of the file as the value.
Managed Service for Apache Spark uses default values for any unset
environment variables.Machine Type: Select the Compute Engine machine type.The Open JupyterLab link for the Dataproc Hub instance becomes active after the instance is created. Users click this link to open the JupyterHub server page to configure and create a Managed Service for Apache Spark JupyterLab cluster (see Use Dataproc Hub).
gcloud compute instances delete --project=${PROJECT} ${INSTANCE_NAME}
gcloud storage rm gs://${BUCKET_NAME} --recursive
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 2026-07-17 UTC.