Create a Dataproc cluster by using a template

This page shows you how to use an inlineGoogle APIs Explorer template to call the Dataproc API to create a Dataproc cluster.

For other ways to create a cluster, see:

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.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.create permission.Learn how to grant roles.
    Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Dataproc API.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enable permission.Learn how to grant roles.

    Enable the API

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

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.create permission.Learn how to grant roles.
    Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.

    Go to project selector

  6. Verify that billing is enabled for your Google Cloud project.

  7. Enable the Dataproc API.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enable permission.Learn how to grant roles.

    Enable the API

Create a cluster

Before you can run Dataproc jobs, you need to create a clusterof virtual machines to run them on. To create a Dataproc clusterin your project, fill in and execute the Google APIs ExplorerTry this APItemplate.

Note: Theregion andclusterName parameter values are filled in for you.Accept or replace these "seeded" parameter values.
  1. Request parameters:

    1. Insert yourprojectId.
    2. Specify theregionwhere your cluster will be located (accept or replace "us-central1"). Since youare not specifying a zone within the region in this quickstart,Dataproc Auto Zone placementwill pick a zone within the region where it will create the cluster.
  2. Request body:

    1. Specify aclusterName,(accept or replace "example-cluster").You will use this name to interact with your cluster, for example when yousubmit jobsorupdate the cluster.
  3. ClickEXECUTE. The first time yourun the API template, you may be asked to choose and sign intoyour Google account, then authorize the Google APIs Explorer to access youraccount. If the request is successful, the JSON responseshows that cluster creation is pending.

  4. To confirm cluster creation, open theDataproc Clusterspage in the Google Cloud console. After cluster provisioning completes,the cluster's status will show as "Running".

Clean up

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

  1. If you don't need the cluster to explore the other quickstarts or to runother jobs, use theAPIs Explorer, theGoogle Cloud console,the gcloud CLIgcloud command-line tool,or theCloud Client Librariesto delete the cluster.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.