# Connect to Google Drive

Google Drive is a cloud-based storage service offered by Google that allows users to store, sync, and share files across devices.

With the Google Drive connector, Datalore allows you to access data in your Google Drive folders from your notebook environment. You can query datasets directly using SQL, Python, Scala, Kotlin, or R without the need for intermediate data exports.

> **Note:**
> Datalore cannot access or download native files created by Google Workspace applications, such as Google Docs, Google Sheets, Google Slides, or Google Forms.

Security considerations
: * Once you create a connection, all the files and subfolders in the selected folder become available in the ![Attach](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/attach.svg)Attached data section. The content of this folder can be accessed by anyone who has edit permissions for the notebook or workspace. Keep this in mind when you share a workspace or notebook that uses your Google Drive connection.
:
: * Other users cannot access any content in your Google Drive beyond the selected folder, and they cannot select another folder in an existing connection.
:
: * Google Drive credentials cannot be accessed from the notebook runtime environment, for example, as environment variables.

Procedure: Step 1. Create a connection

> **Note: On-Premises prerequisite**
> In Datalore On-Premises, the [Google Drive connection must be configured in the Datalore Admin panel](configure-google-drive.html) before you can connect your Google Drive to a workspace or notebook.
>
>
>
> If you are unsure whether the connection is configured or if you encounter errors when creating a Google Drive connection, contact your Datalore administrator.

You can create a Google Drive connection either in your notebook or workspace.

1. To create a connection:

In a workspace:

1.

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

2.

In the sidebar, 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 icon](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 Drive.

In a notebook:

1. Open the notebook where you want to add a Google Drive 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 Drive.

2. In the pop-up window, log in to the Google account you want to connect, or select it from the list if you are already logged in.

> **Note:**
> If you cannot see the pop-up, it is likely that your browser blocked it. To show the pop-up, you should usually click on the pop-up icon in the address bar.

3. Follow the prompts and allow access to your Google Drive.

Procedure: Step 2. Configure the connection

1. In the New Google Drive cloud storage connection dialog, enter the data source name in Display name.

This name also becomes part of the path where the connection is mounted.

![New Google Drive cloud storage connection dialog](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/gd.png)

2. Select a folder in your Google Drive that you want to use as the data source.

> **Tip:**
> You can only add one Google Drive folder in a connection. If you want to add several folders, add them as separate connections.
>
>
>
> The root folder cannot be added as a connection and files in it cannot be accessed from Datalore.

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 Drive connection.

![Google Drive connection сard in the Attached data section](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/attached_gd.png)

Procedure: Step 4. Use the connection in the notebook

After the connection is mounted, you can access files in the Google Drive folder from your notebook code:

```PYTHON
import pandas as pd

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

```KOTLIN
%use dataframe

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

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

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

print(df)
```

The connection’s mount path, such as `/data/google_drive/`, is shown on the connection card. To copy the path, click `∙∙∙ | Copy directory path`.

## Next steps

* Learn how to manage and delete Google Drive 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 Drive, connect to remote folders, connect to remote storages

