Running Airflow 3 on your laptop
Running Airflow on your laptop is the quickest way to learn it and to test DAGs before they reach production. This lesson shows a safe installation, the standalone mode for a first run, and Docker Compose for a setup closer to production.
Pipelines in production · Airflow · Bronze · Orchestration basics, lesson 3 of 3
On this page
Read first: A DAG file, line by line (skip if you know it)
In plain words first
Before opening a restaurant, a chef practises the menu in a home kitchen: same recipes, smaller stove. Running Airflow locally is that home kitchen. The DAGsDAG: A pipeline in Airflow: a set of tasks and the order they run in, defined in a Python file and run on a schedule. Learn more → you write here are the same ones production will run.
Install with constraints
Airflow has hundreds of dependencies, and a plain pip install apache-airflow can pull versions that do not work together. Each release publishes a constraints file that pins a set known to work; install with it, in a fresh virtual environment.
python -m venv airflow-venv && source airflow-venv/bin/activate
AIRFLOW_VERSION=3.3.2
PYTHON_VERSION="$(python -c 'import sys; print("%d.%d" % sys.version_info[:2])')"
BASE="https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}"
pip install "apache-airflow==${AIRFLOW_VERSION}" \
--constraint "${BASE}/constraints-${PYTHON_VERSION}.txt"
airflow standalone
export AIRFLOW_HOME=~/airflow # config, the SQLite database and logs live here airflow standalone # creates the database, a user, starts every component
- It starts the schedulerscheduler: The Airflow process that reads DAG files, creates runs when they are due, and queues the tasks whose upstream tasks are done. Learn more →, the DAG processor, the triggerer and the API server in one terminal, with a SQLite database: fine for learning, not for production.
- The UI is at
http://localhost:8080. The login and its generated password are printed in the terminal and saved under$AIRFLOW_HOME. - Put DAG files in
$AIRFLOW_HOME/dags. A new file shows up in the UI after the next parse, within a minute. - New DAGs start paused by default: unpause one in the UI before it schedules anything.
When a DAG does not show up
airflow dags list # the DAGs Airflow found airflow dags list-import-errors # files that failed to import, with the traceback
A file that raises an exception at import time is shown as a "Broken DAG" banner in the UI and listed by list-import-errors. The usual causes: a typo, a missing package on the Airflow machine, something Airflow 3 removed (DummyOperator, days_ago, schedule_interval), or a @dag function that is never called (no error at all: the DAG simply does not exist). Older import paths such as airflow.operators.bash still load in Airflow 3, with a deprecation warning; move them to their new homes before they are removed.
Testing without the scheduler
# one full run for that logical date airflow dags test charts_daily 2026-03-01 # one task, nothing recorded as state airflow tasks test charts_daily aggregate 2026-03-01
dags test runs every tasktask: One step of a DAG, such as running a query or calling an API. Each run of a task for one date is a task instance. Learn more → of one run in a single process, in dependency order, and prints their logs: the fastest way to check a DAG end to end. tasks test runs one task with the context of the given date and ignores its dependencies. Both work without unpausing anything. The Airflow practice problems on this site go one step further: they simulate the scheduler over days of runs, which is what these commands cannot show.
Common mistakes
- pip install without the constraints file — Incompatible dependency versions and confusing import errors.
- Waiting for a paused DAG to run — New DAGs start paused; unpause it.
- Running production on airflow standalone — SQLite and one machine: use a real database and executorexecutor: The part of Airflow that decides where queued tasks run: in local processes, on Celery workers or as Kubernetes pods. Learn more →.
- Debugging a missing DAG only in the UI — airflow dags list-import-errors shows the traceback.
Key takeaways
- Install Airflow with the constraints file for your Airflow and Python versions.
- airflow standalone runs everything locally; DAG files go in $AIRFLOW_HOME/dags.
- list-import-errors explains a missing DAG.
- airflow dags test runs one whole run in a single process.
Interview prep
THE QUESTION
"Your new DAG file is in the dags folder but does not appear in the UI. How do you find out why?"
Avoid: "pip install apache-airflow and it works". Without the constraints file the resolver can pick incompatible versions of Airflow's many dependencies.
Follow-ups · answer out loud, then open
Follow-up"What is the difference between airflow dags test and airflow tasks test?"
Scenario"Your DAG works locally but shows as broken in production. Where do you look?"
Trap"airflow standalone is fine for production if the machine is big."
Check yourself
3 questionsWhy install Airflow with a constraints file?
Show the answer
It pins dependency versions known to work together. Airflow has many dependencies; the constraints file pins a tested set.
A new DAG appears in the UI but never runs. What is the most likely reason?
Show the answer
It is paused, as new DAGs are by default. DAGs start paused unless configured otherwise.
What does airflow dags test do?
Show the answer
Runs every task of one run in a single process. It executes a full run locally, in dependency order.
Keep going
Up next · new module: Schedules · 5 min readSchedules and logical dates
Cron strings, presets and timetables, and what a run's logical date means in Airflow 3.
Related lessons
Previous: A DAG file, line by line
Primary sources: Installation from PyPI · Quick start · Testing DAGs