# Connect to Google Cloud Storage

Google Cloud Storage is a cloud-based object storage service provided by Google Cloud that allows users to store, manage, and retrieve large amounts of unstructured data.

With the Google Cloud Storage connector, Datalore allows you to access data in your Cloud Storage bucket directly from your notebook environment.

Before you begin
: Obtain a service account key from the Google Cloud console or [create a new one](https://cloud.google.com/iam/docs/keys-create-delete#creating). Save the key as a `.json` file.

Procedure: Step 1. Create a connection

You can create a Google Cloud Storage connection either from a notebook or workspace.

In a workspace:

1.

In the sidebar on the Home page, select the workspace where you want to add a Google Cloud Storage connection.

2.

In the expanded list of workspace resources, select ![Document](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/document.svg)Data and switch to the Cloud storage tab.

![Cloud storage tab](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/cloud-storage.png)

3.  Click ![Plus](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/plus.svg) New cloud storage connection at the top right.

4.  In the `New cloud storage connection` dialog, select Google Cloud Storage.

In a notebook:

1. Open the notebook where you want to add a Google Cloud Storage connection.

2.

In the sidebar, select ![Attach](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/attach.svg)Attached data and switch to the Cloud storage tab.

![Cloud storage tab in the Attached data section](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/cloud-storage-notebook.png)

3.  Click ![Plus](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/plus.svg)New cloud storage.

4.

In the `New cloud storage connection` dialog, select Google Cloud Storage.

Procedure: Step 2. Configure the connection

1. In the New Google Cloud Storage connection dialog, fill in the following fields:

* Display name: Enter the connection name to be displayed in Datalore. This name also becomes part of the path where the connection is mounted.

* GCS bucket name: Specify the name of the Cloud Storage bucket you want to mount.

* GCS key file content: Paste the content of the Google service account key file.

![New Google Cloud Storage connection](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/gcs.png)

2. (Optional) Click Test connection to make sure the provided credentials are correct.

3. Click Create and close.

Procedure: Step 3. Attach the connection to a notebook

1. Open the notebook you want to attach the connection to.

2. If the notebook is not running, start it by clicking `Run | Start machine`.

3. In the sidebar, select ![Attach](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/attach.svg)Attached data and switch to the Cloud storage tab.

4. Enable the toggle in your Google Cloud Storage connection.

Procedure: Step 4. Use the connection in the notebook

After the connection is mounted, you can access files in the Cloud Storage bucket from your notebook code:

Python:

```PY
import pandas as pd

df = pd.read_csv(f"/data/google_cloud/my_file.csv")
df
```

Kotlin:

```KOTLIN
%use dataframe

val df = DataFrame.readCsv("/data/google_cloud/my_file.csv")
df
```

Scala:

```SCALA
val lines = scala.io.Source.fromFile("/data/google_cloud/my_file.txt").mkString
```

R:

```R
df <- read.csv("/data/google_cloud/my_file.csv")

print(df)
```

The connection’s mount path, such as `/data/google_cloud/`, is shown on the connection card.

To copy the path, click ![Three docs icon](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/dots.svg) (More) and select Copy directory path.

## Next steps

* Learn how to manage and delete Google Cloud Storage connections [in a workspace](manage-cloud-storage-connections-in-a-workspace.html) and [in a notebook](manage-cloud-storage-connections-attached-to-a-notebook.html).

## Keywords

cloud storage, cloud storage connection, attach data, data sources, Google Cloud Storage

