Airflow up and running but airflow.cfg file not found


I have set up the Airflow environment but can’t find the airflow.cfg file.Things that I have done so far:

  • Have installed Ubuntu on Windows Wsl.
  • Have installed Airflow on Ubuntu using the following composer file:
  • Airflow is up and running.
  • The task using EmailOperator doesn’t send email.
  • Wanted to configure SMTP parameters in airflow.cfg but haven’t found such a file in local drive and Airflow container.

How is that that Airflow is up and running but airflow.cfg file is not found? It was the official Airflow composer file that I was using.

I would recommend to configure Airflow thru the environment variables rather than modifying the airflow.cfg file. Kindly see Configuration Reference — Airflow Documentation for the SMTP configuration.

Below is where you can set the environment variables in the Docker compose file:

However, if you really wanna see the airflow.cfg file on your local machine, you may do something like this:

If I remember correctly, the airflow.cfg file is located under the path /opt/airflow/ in the Airflow container.