Oluwafisayo Balogun
07/29/2025, 3:14 PMMarvin
07/29/2025, 3:14 PMMarvin
07/29/2025, 3:14 PMbash
# Create and activate a virtual environment (recommended)
python -m venv prefect-env
prefect-env\Scripts\activate
# Install Prefect 2.x
pip install 'prefect<3'
3. Initial Setup:
bash
# Start the Prefect server locally
prefect server start
This will start a local Prefect server and automatically open the UI in your default browser.
4. In a new terminal window:
bash
# Activate your virtual environment again if you're using one
prefect-env\Scripts\activate
# Create and start a default agent (needed to run deployments)
prefect agent start -q 'default'
Important Notes:
- The Prefect UI will be available at http://127.0.0.1:4200 by default
- The server needs to be running for you to use the UI and run workflows
- You can run flows without the server, but the server provides observability and other features
Alternative - Prefect Cloud:
If you prefer to use Prefect Cloud instead of running a local server:
1. Create an account at https://app.prefect.cloud
2. Log in through the CLI:
bash
prefect cloud login
Would you like me to provide any clarification on any of these steps? Also, I'll mention again that if you're just starting with Prefect, you might want to consider Prefect 3.x instead, as it's the latest version with improved features and ongoing support. Let me know if you'd like the installation instructions for 3.x instead!Oluwafisayo Balogun
07/29/2025, 3:17 PM