---
title: "Cloud Synchronization"
description: "Learn how to synchronize cloud and local project via Lean CLI."
canonical: https://www.quantconnect.com/docs/v2/lean-cli/projects/cloud-synchronization
markdown: https://www.quantconnect.com/docs/v2/lean-cli/projects/cloud-synchronization.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/05%20Lean%20CLI/06%20Projects/02%20Cloud%20Synchronization
modified: 2026-10-28
index: https://www.quantconnect.com/llms.txt
---

# Cloud Synchronization

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Lean CLI](https://www.quantconnect.com/docs/v2/lean-cli.md) > Projects > Cloud Synchronization

> Code examples are shown in Python. Append `?lang=csharp` to this URL for the C# version of this page.

## Introduction

Cloud synchronization allows you to synchronize your projects in QuantConnect Cloud with your local drive using the Lean CLI. Cloud synchronization makes it possible to use your local development environment when writing your algorithms while using QuantConnect's infrastructure and data library when executing them.

The [terminal UI](https://www.quantconnect.com/docs/v2/lean-cli/projects/ui.md) shows which projects are in both locations and lets you push or pull a project with one key.

To use the CLI, you must be a member in an [organization](https://www.quantconnect.com/docs/v2/cloud-platform/organizations/tier-features.md) on a paid tier.

## Pulling Cloud Projects

Follow these steps to pull all the cloud projects that you store in an [organization](https://www.quantconnect.com/docs/v2/cloud-platform/organizations/getting-started.md) to your local drive:

1. [Log in](https://www.quantconnect.com/docs/v2/lean-cli/initialization/authentication.md#02-Log-In) to the CLI if you haven't done so already.
2. Open a terminal in the [organization workspace](https://www.quantconnect.com/docs/v2/lean-cli/initialization/organization-workspaces.md) from which you want to pull projects.
3. Run `lean cloud pull` to pull all your cloud projects to the current directory, creating directories where necessary.

   ```
   $ lean cloud pull
   [1/3] Pulling 'Creative Red Mule'
   Successfully pulled 'Creative Red Mule/main.py'
   [2/3] Pulling 'Determined Yellow-Green Duck'
   Successfully pulled 'Determined Yellow-Green Duck/main.py'
   Successfully pulled 'Determined Yellow-Green Duck/research.ipynb'
   [3/3] Pulling 'Halloween Strategy'
   Successfully pulled 'Halloween Strategy/benchmark.py'
   Successfully pulled 'Halloween Strategy/main.py'
   Successfully pulled 'Halloween Strategy/research.ipynb'
   ```
4. Update your projects to [include the required imports](https://www.quantconnect.com/docs/v2/lean-cli/projects/autocomplete.md#07-Imports) to run the projects locally and to make autocomplete work.

Follow these steps to pull a single cloud project to your local drive:

1. [Log in](https://www.quantconnect.com/docs/v2/lean-cli/initialization/authentication.md#02-Log-In) to the CLI if you haven't done so already.
2. Open a terminal in the [organization workspace](https://www.quantconnect.com/docs/v2/lean-cli/initialization/organization-workspaces.md) that stores the project.
3. Run `lean cloud pull --project "<projectName>"` to pull the project named "<projectName>" to `. / <projectName>`.

   ```
   $ lean cloud pull --project "My Project"
   [1/1] Pulling 'My Project'
   Successfully pulled 'My Project/main.py'
   Successfully pulled 'My Project/research.ipynb'
   ```
4. Update your project to [include the required imports](https://www.quantconnect.com/docs/v2/lean-cli/projects/autocomplete.md#07-Imports) to run the project locally and to make autocomplete work.

If you have a local copy of the project when you pull the project from the cloud, the configuration values of the cloud project overwrite the [configuration values of your local copy](https://www.quantconnect.com/docs/v2/lean-cli/projects/configuration.md#02-Properties).

If one of your team members creates a [project library](https://www.quantconnect.com/docs/v2/lean-cli/projects/libraries/project-libraries.md), adds it to a project, and then adds you as a collaborator to the project, you can pull the project but not the library. To pull the library as well, your team member must add you as a collaborator on the library project.

## Pushing Local Projects

Follow these steps to push all the local projects in an [organization workspace](https://www.quantconnect.com/docs/v2/lean-cli/initialization/organization-workspaces.md) to the cloud:

1. [Log in](https://www.quantconnect.com/docs/v2/lean-cli/initialization/authentication.md#02-Log-In) to the CLI if you haven't done so already.
2. Open a terminal in the organization workspace.
3. Run `lean cloud push` to push all your local projects in the organization to the cloud, creating new cloud projects where necessary.

   ```
   $ lean cloud push
   [1/3] Pushing 'Alpha'
   Successfully created cloud project 'Alpha'
   Successfully created cloud file 'Alpha/benchmark.py'
   Successfully updated cloud file 'Alpha/main.py'
   Successfully updated cloud file 'Alpha/research.ipynb'
   [2/3] Pushing 'Buy and Hold BNBUSDT'
   Successfully created cloud project 'Buy and Hold BNBUSDT'
   Successfully updated cloud file 'Buy and Hold BNBUSDT/main.py'
   Successfully updated cloud file 'Buy and Hold BNBUSDT/research.ipynb'
   [3/3] Pushing 'Creative Red Mule'
   Successfully updated cloud file 'Creative Red Mule/main.py'
   ```

Follow these steps to push a single local project to the cloud:

1. [Log in](https://www.quantconnect.com/docs/v2/lean-cli/initialization/authentication.md#02-Log-In) to the CLI if you haven't done so already.
2. Open a terminal in the [organization workspace](https://www.quantconnect.com/docs/v2/lean-cli/initialization/organization-workspaces.md) that contains the project you want to push.
3. Run `lean cloud push --project "<projectName>"` to push the project stored in `. / <projectName>` to the cloud.

   ```
   $ lean cloud push --project "My Project"
   [1/1] Pushing 'My Project'
   Successfully updated cloud file 'My Project/main.py'
   ```

If you create a project on your local machine and push it to the cloud, the `lean cloud push` command creates the cloud version of the project in the organization that's linked to your current organization workspace.

If you have a cloud copy of the project when you push the project from your local machine, the [configuration values of your local project](https://www.quantconnect.com/docs/v2/lean-cli/projects/configuration.md#02-Properties) overwrite the configuration values of your cloud copy.

The CLI only pushes the [supported file types](https://www.quantconnect.com/docs/v2/cloud-platform/projects/files.md#02-Supported-File-Types) in your projects.

## Detecting Environment

Sometimes it might be useful to run certain logic only when your algorithm is running locally, or when it is running in the cloud. You can use the following code snippet to check where your algorithm is running (replace `Computer` with your computer's hostname):

```python
import platform

if platform.node() == "Computer":
    # Running locally
    pass
else:
    # Running in the cloud
    pass
```
