Like most people, I thought Apache Airflow and Astronomer were confusing. However, after getting hands-on experience, I’ve come to really appreciate what makes Airflow so widely used. It turns out, building DAGs (Directed Acyclic Graphs) is intuitive once you get the hang of it. And I promise you, after reading this blog, it’ll make a lot more sense why Astro CLI is the easiest way to go.
Setting up Apache Airflow locally with Astro CLI, assuming Docker and the CLI are already installed, takes about 5–10 minutes if everything goes smoothly. To emphasize, this is just the setup process, it might take you longer to understand the UI and how to define your DAGs. In this blog, I’ll share how I set up Airflow locally using Astronomer and explain why the Astro CLI is the fastest and easiest way to get started.
Why do you need Astro CLI?
The Astro CLI is an open-source command-line tool that simplifies working with Apache Airflow, especially for local development. While you can install and run Airflow manually (e.g., via PyPI or Docker), Astro CLI provides a streamlined experience with key enhancements:
The “Secret Sauce” of Astro CLI:
- Free and open source: You don’t need to be an Astronomer customer, anyone can use it on Mac, Windows, or Linux.
- Pre-configured Airflow setup: Astro CLI bootstraps a production like Airflow environment out of the box (via Docker), including the webserver, scheduler, metadata database, and logs.
- Zero manual config: No need to configure environment variables, databases, or Airflow components yourself.
- Project scaffolding: Automatically generates an Airflow project structure with folders for DAGs, plugins, and dependencies.
- Tight local-dev loop: Run astro dev start and you’re up and running; make code changes and test DAGs locally in seconds.
Step 0: Local Installation Options
There are three ways to install Airflow on your local machine:
1. Using the Python Package Index (PyPI)
This method is great for anyone comfortable with Python environments or who only has access to Python locally.
2. Using Containerization Solutions (e.g., Docker, Podman)
This is ideal for users already familiar with containers.
3. Using Astro CLI (Recommended)
Astro CLI simplifies the entire process by automating setup through containerization. It requires minimal manual configuration and is the fastest, most beginner-friendly way to get a local Airflow environment up and running. Overall ideal for development and experimentation.
Method | Pros | Cons |
---|---|---|
PyPI (Python-only) | Familiar for Python users | Manual setup, dependency management, less scalable |
Docker/Podman | Clean environment, better isolation | Requires container knowledge, more config needed |
Astro CLI (Recommended) | Fast setup, beginner-friendly, preconfigured structure | Requires Docker/Podman, slight learning curve on CLI usage |
Step 1: Set up and Run an Airflow Project
Prerequisites:
- Windows 10 or 11
- Windows Subsystem for Linux (WSL) 2 enabled
- Docker or Podman
Installation (via winget):
- Open Windows PowerShell as an administrator and then run the following command: winget install -e –id Astronomer.Astro
- Run astro version to confirm the Astro CLI is installed properly.
Astro CLI also supports Windows (via manual install), mac and Linux (via curl).
For full setup instructions across all operating systems, check the official Astro docs here: Astro CLI Installation Guide
Step 2: Initialize a New Airflow Project
Once Astro CLI is installed, create a new folder for your project and run: astro dev init
This command will generate a standard Astro project structure with all necessary folders and files. And if you open your code editor of your choice in that folder (I’m using vscode), you’ll have all those files and directories that have been generated for you on the left side.
And just like that, you have a fully functional local environment to run Airflow.
Step 3: Run Airflow locally
- Run the following command from your project directory: astro dev start
- After your project builds successfully, open the Airflow UI in your web browser at https://localhost:8080/.
Final thoughts
Getting started with Apache Airflow can seem intimidating at first, but tools like the Astro CLI make the process far more accessible, especially for beginners or those just looking to prototype quickly. With just a few commands, you can start building and testing DAGs in no time.
Now that your local Airflow setup is up and running, the only thing left to schedule… is your coffee break. Happy orchestrating!