⚡ Deploy your code to Prefect Cloud in seconds! ⚡
Deploy and run your Python functions on Prefect Cloud with a single command.
First, install uv if you haven't already. See installation docs here
curl -LsSf https://astral.sh/uv/install.sh | shCreate and activate a virtual environment:
uv venv && source .venv/bin/activateThen install prefect-cloud:
uv pip install prefect-cloudAlternatively, you can run prefect-cloud as a tool without installing it using uvx. See uv tools guide for more details.
If you prefer to run without installing, you can use uvx to run prefect-cloud commands directly:
# Login to Prefect Cloud
uvx prefect-cloud login
# Connect to GitHub (for private repos)
uvx prefect-cloud github setup
# Deploy your workflow
uvx prefect-cloud deploy examples/hello.py:hello_world --from PrefectHQ/prefect-cloud
# Run it
uvx prefect-cloud run hello_world/hello_world
# Schedule it
uvx prefect-cloud schedule hello_world/hello_world "0 * * * *"prefect-cloud loginDeploy any Python function from a GitHub repository. For example:
# https://github.com/ExampleOwner/example-repo-cloud/blob/main/examples/hello.py
def hello_world():
print("Hello, World!")prefect-cloud deploy <path/to/file.py:function_name> --from <source repo URL>
e.g.
prefect-cloud deploy examples/hello.py:hello_world --from PrefectHQ/prefect-cloudprefect-cloud run <flow_name>/<deployment_name>e.g.
prefect-cloud run hello_world/hello_worldprefect-cloud schedule <flow_name>/<deployment_name> <SCHEDULE>e.g.
prefect-cloud schedule hello_world/hello_world "0 * * * *"Add Dependencies
# Add dependencies
prefect-cloud deploy ... --with pandas --with numpy
# Or install from requirements file at runtime
prefect-cloud deploy ... --with-requirements </path/to/requirements.txt>Include Environment Variables
prefect-cloud deploy ... --env KEY=VALUE --env KEY2=VALUE2Include Secrets as Environment Variables
# Create or replace secrets with actual values
prefect-cloud deploy ... --secret API_KEY=actual-secret-value --secret DB_PASSWORD=another-secret-value
# Reference existing secret blocks
prefect-cloud deploy ... --secret API_KEY="{existing-api-key-block}" --secret DB_PASSWORD="{my-database-password}"From a Private Repository
(Recommended!) Install the Prefect Cloud GitHub App into the repository you want to deploy from. This will allow you to deploy from private repositories without needing to provide a personal access token.
prefect-cloud github setupAlternatively, you can provide a personal access token on each deploy:
prefect-cloud deploy ... --from <private source repo URL> --credentials GITHUB_TOKEN