The [Apache Zeppelin](https://zeppelin.apache.org/) optional component lets you run web-based, interactive data analytics on your clusters. You can install Zeppelin when creating a Managed Service for Apache Spark cluster using [optional components](https://docs.cloud.google.com/managed-spark/docs/concepts/components/overview.md.txt#available_optional_components) to execute Spark workloads and visualize data in shared notebooks.
- Zeppelin can be configured by providing `zeppelin` and `zeppelin-env` prefixed [cluster properties](https://docs.cloud.google.com/managed-spark/docs/concepts/configuring-clusters/cluster-properties.md.txt#formatting).
  - To reduce the risk of remote code execution over unsecured notebook server APIs, the default `zeppelin:zeppelin.server.addr` cluster property setting for image versions 1.3+ is `127.0.0.1`, which restricts connections to `localhost` when [Component Gateway](https://docs.cloud.google.com/managed-spark/docs/concepts/accessing/gateways.md.txt) is enabled.

The [Zeppelin Notebook](https://zeppelin.apache.org/)
component is a Web-based notebook for interactive data analytics. The Zeppelin
Web UI is available on port `8080` on the cluster's first master node.

By default, notebooks are saved in Cloud Storage
in the Managed Service for Apache Spark staging bucket, which is specified by the user or
[auto-created](https://docs.cloud.google.com/managed-spark/docs/guides/create-cluster.md.txt#auto-created_staging_bucket)
when the cluster is created. The location can be changed at cluster creation
time via the
[`zeppelin:zeppelin.notebook.gcs.dir` property](https://docs.cloud.google.com/managed-spark/docs/concepts/configuring-clusters/cluster-properties.md.txt#dataproc-properties).

## Install the component

Install the component when you create a Managed Service for Apache Spark cluster.
Components can be added to clusters created with
Managed Service for Apache Spark [version 1.3](https://docs.cloud.google.com/managed-spark/docs/concepts/versioning/dataproc-release-1.3)
and later.

See
[Supported Dataproc versions](https://docs.cloud.google.com/managed-spark/docs/concepts/versioning/dataproc-versions#supported_cloud_dataproc_versions)
for the component version included in each Managed Service for Apache Spark image release.

### Google Cloud console

1. In the Google Cloud console, open [**Create cluster**](https://console.cloud.google.com/dataproc/clusters/create) page.
2. Click **Additional configuration** to expand that section.
3. Edit **Optional components**.
4. In the panel that opens, select the checkbox for **Zeppelin Notebook** , then click **Save**.

### gcloud CLI

To create a Managed Service for Apache Spark cluster that includes the Zeppelin component,
use the
[gcloud dataproc clusters create](https://docs.cloud.google.com/sdk/gcloud/reference/dataproc/clusters/create.md.txt) <var translate="no">cluster-name</var>
command with the `--optional-components` flag.

> [!IMPORTANT]
> When creating the cluster (image version 1.3.29 or later), use [gcloud dataproc clusters create](https://docs.cloud.google.com/sdk/gcloud/reference/dataproc/clusters/create.md.txt) command with the `--enable-component-gateway` flag, as shown below, to enable connecting to the Zeppelin notebook Web UI using the [Component Gateway](https://docs.cloud.google.com/managed-spark/docs/concepts/accessing/gateways.md.txt).

```
gcloud dataproc clusters create cluster-name \
    --optional-components=ZEPPELIN \
    --region=region \
    --enable-component-gateway \
    ... other flags
```

### REST API

The Zeppelin component can be specified through the Dataproc API using [SoftwareConfig.Component](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/ClusterConfig.md.txt#Component) as part of a [clusters.create](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.clusters/create.md.txt) request.

> [!IMPORTANT]
> Using the [Dataproc `v1` API](https://docs.cloud.google.com/managed-spark/docs/reference/rest.md.txt), set the [EndpointConfig.enableHttpPortAccess](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/ClusterConfig.md.txt#endpointconfig) property to `true` as part of the clusters.create request to enable connecting to the Zeppelin notebook Web UI using the [Component Gateway](https://docs.cloud.google.com/managed-spark/docs/concepts/accessing/gateways.md.txt).

## Open the Zeppelin notebook

See [Viewing and Accessing Component Gateway URLs](https://docs.cloud.google.com/managed-spark/docs/concepts/accessing/gateways.md.txt#viewing_and_accessing_component_gateway_urls)
to click Component Gateway links on the Google Cloud console to open the
Zeppelin notebook UI running on the cluster's master node in your local
browser.