- Set up Airflow local instance
# 2.9.3
python3.11 -m venv airflow-2.9.3
source airflow-2.9.3/bin/activate
# 3.1.3
python3.12 -m venv airflow-3.1.1
source airflow-3.1.1/bin/activate# 2.9.3
curl -LfO 'https://airflow.apache.org/docs/apache-airflow/2.9.3/docker-compose.yaml'
# 3.1.3
curl -LfO 'https://airflow.apache.org/docs/apache-airflow/3.1.3/docker-compose.yaml'| Python Version | Status in Airflow 2.9.3 | Notes |
|---|---|---|
| 3.8 | Supported | N/A |
| 3.9 | Supported | N/A |
| 3.10 | Supported | Recommended for high stability. |
| 3.11 | Supported | Recommended for performance/stability balance. |
| 3.12 | Supported | Requires pendulum>=3.0.0. |
| 3.13+ | Not Supported | Support for 3.13+ is not available in the 2.9.x series. |
For the official apache/airflow:2.9.3 Docker image (without a suffix), the default Python version is Python 3.12
If you pull the following tags, here is what you get:
| Tag | Resulting Python Version |
|---|---|
apache/airflow:2.9.3 |
Python 3.12 (Default) |
apache/airflow:2.9.3-python3.11 |
Python 3.11 |
apache/airflow:2.9.3-python3.8 |
Python 3.8 |
Recommendation is to change your default docker-compose file to use apache/airflow:2.9.3-python3.11
${AIRFLOW_IMAGE_NAME:-apache/airflow:2.9.3-python3.11}mkdir -p ./dags ./logs ./plugins ./config
echo -e "AIRFLOW_UID=$(id -u)" > .env- uncomment
AIRFLOW_CONFIGfromdocker-composefile and run
docker compose --file docker-compose.yml run airflow-cli airflow config listYou can test a DAG locally by spinning up a local airflow instance using docker compose
docker compose --file docker-compose.yml upYou should be able to access Airflow UI on http://localhost:8080
Once finished testing, you can bring down your airflow instance by running
docker compose --file docker-compose.yml down