# Overview and Setup
Welcome to the Prefect Deployment Tutorial! This tutorial will cover:
- Setting up your environment to use either Prefect Cloud or Prefect Server
- Configuring and registering your first Flow
- Using a Prefect Agent to run that Flow
If you haven't yet, you might want to go through the Prefect Core Tutorial, which covers in greater detail how to write Prefect Flows.
# Install Prefect
Before starting the tutorial, you'll need a working install of the core Prefect library.
You can find installation instructions here.
# Select an Orchestration Backend
Prefect supports two different orchestration backends:
cloud
- our hosted serviceserver
- the open source backend, deployed on your infrastructure
To use Prefect with either backend, you must first select that backend via the CLI:
$ prefect backend cloud
$ prefect backend server
Note that you can change backends at any time by rerunning the prefect backend ...
command.
# Authenticating with Prefect Cloud Cloud
If you're using Prefect Cloud, you'll also need to authenticate with the backend before you can proceed further.
# Create a Personal Access Token
To authenticate, you'll need to create a Personal Access Token and configure it with the Prefect Command Line Interface.
- Login to https://cloud.prefect.io
- In the hamburger menu in the top left corner go to User -> Personal Access Tokens -> Create A Token.
- Copy the created token
- Configure the CLI to use the access token by running
prefect auth login -t <COPIED_TOKEN>
# Create a Runner Token
Running deployed Flows with an Agent
also requires a RUNNER
-scoped API token for the Agent. You can create one
using the CLI:
prefect auth create-token -n my-runner-token -s RUNNER
You'll need this token later in the tutorial. You can save it locally either in
your ~/.prefect/config.toml
config file, or as an environment variable:
# ~/.prefect/config.toml
[cloud.agent]
auth_token = <COPIED_RUNNER_TOKEN>
export PREFECT__CLOUD__AGENT__AUTH_TOKEN=<COPIED_RUNNER_TOKEN>
← Welcome First Flow →