0
0
AirflowHow-ToBeginner ยท 3 min read

Where is airflow.cfg Located in Apache Airflow?

The airflow.cfg file is usually located in the Airflow home directory, which defaults to ~/airflow/. You can find the exact path by running airflow info and looking for the config_file entry.
๐Ÿ“

Syntax

The main command to find the airflow.cfg location is:

  • airflow info: Displays Airflow environment details including the config file path.

The airflow.cfg file itself is a plain text file with key-value pairs for Airflow settings.

bash
airflow info
๐Ÿ’ป

Example

This example shows how to find the airflow.cfg file path using the airflow info command.

bash
airflow info | grep config_file
Output
/home/username/airflow/airflow.cfg
โš ๏ธ

Common Pitfalls

Sometimes users expect airflow.cfg in system folders or the current directory, but it is actually in the Airflow home directory.

If you set the AIRFLOW_HOME environment variable, the config file will be inside that folder instead of the default ~/airflow/.

Also, running Airflow commands inside a virtual environment or container might change the location.

bash
### Wrong way: looking in current directory
ls airflow.cfg

### Right way: check with airflow info
airflow info | grep config_file
๐Ÿ“Š

Quick Reference

Summary tips to locate airflow.cfg:

  • Default location: ~/airflow/airflow.cfg
  • Check AIRFLOW_HOME environment variable for custom location
  • Use airflow info to find exact config file path
  • Config file is a plain text file editable to change Airflow settings
โœ…

Key Takeaways

The airflow.cfg file is located in the Airflow home directory, defaulting to ~/airflow/airflow.cfg.
Run airflow info and look for config_file to find the exact path of airflow.cfg.
Setting AIRFLOW_HOME changes where airflow.cfg is stored.
Do not expect airflow.cfg in the current directory unless AIRFLOW_HOME is set there.
Edit airflow.cfg carefully to configure Airflow behavior.