How to Run Apache Airflow Locally: Docker Compose, Astro CLI, pip or a Lab

Short answer: there are four common ways to run Airflow on your own computer. The official Docker Compose setup is closest to a real deployment. The Astro CLI is built for developing real projects. `pip install` with `airflow standalone` is the lightest. A one-container lab such as the Airflow Lab is the quickest if you only want to learn. Pick by what you need to do.

Open the Airflow Lab

The four options

| Option | Best for | What you need | Trade-off | |---|---|---|---| | [Official Docker Compose](https://airflow.apache.org/docs/apache-airflow/stable/howto/docker-compose/index.html) | A setup close to a real deployment, with several services | Docker, a Compose file and some setup | More to configure and more to keep running | | [Astro CLI](https://www.astronomer.io/docs/astro/cli/local-airflow-overview) | Developing and testing a real Airflow project | The Astro CLI | A tool to learn, built around Astronomer's workflow | | `pip install` and `airflow standalone` | A quick run with no Docker | Python and a virtual environment | You manage Python and package versions yourself | | Airflow Lab | Learning Airflow and Spark with lessons | Docker Desktop only | A learning lab, not a production setup |

Which one should you pick?

  • **You want to learn Airflow this week.** Use a lab: two Docker commands, an editor in the browser, and lessons that run. Nothing to configure.
  • **You are building DAGs for work.** Use the Astro CLI or the official Docker Compose setup, so your local environment looks like where the DAGs will run.
  • **You cannot use Docker.** Use a Python virtual environment and `airflow standalone`, following the official instructions for your Airflow version.

Two things that trip people up

  • **Versions.** Airflow 3 changed the imports (`airflow.sdk` instead of `airflow`). A tutorial written for Airflow 2 will fail with import errors on Airflow 3. Check the version first. This guide has a comparison table.
  • **Docker needs room.** A multi-service setup uses a lot of memory and disk. If your laptop is small, a single container is easier on it.

Start the lab

1. Install Docker Desktop.

2. Open the Airflow Lab and run the Set up and Start commands.

3. Paste the token, connect, and press Test DAG on lesson 1.

You get Airflow 3, PySpark, the real Airflow UI and the Spark UI, and your files stay on your computer.

Open the Airflow Lab

Related tool pages

Also try

How to use the Airflow Lab: step by step

  1. Decide what you need: learning, developing or running without Docker
  2. Pick the matching option from the table
  3. For learning, start the Airflow Lab
  4. Run your first DAG

When to use the Airflow Lab

  • Choosing a local Airflow setup
  • Setting up Airflow on a laptop for the first time
  • Deciding between a lab and a development tool
  • Helping a colleague start with Airflow

Example

Input: a DAG that cleans data, runs a Spark job and lists the result

Output: Task states in the lab, the DAG in the Airflow UI, the job in the Spark UI

Frequently asked questions

What is the easiest way to run Airflow locally?

For learning, a one-container lab such as the Airflow Lab: install Docker Desktop and run two commands. For project work, the official Docker Compose setup or the Astro CLI are the usual choices.

Can I run Airflow without Docker?

Yes. You can install it with pip in a virtual environment and start it with airflow standalone, following the official instructions for your Airflow version.

Why do older Airflow tutorials fail on Airflow 3?

Airflow 3 moved the main imports to airflow.sdk and moved operators such as BashOperator to airflow.providers.standard. Code written for Airflow 2 needs those imports changed.

Tip: If you are learning, start with the lab. If you later build DAGs for work, move to the setup your team uses.