Install Airflow on macOS

Page content

Hi, I am coder2j.

In this airflow tutorial, I will show you how to install Airflow on macOS.

If you are a video person, check out the YouTube video.

Let’s dive right in!

At the time of writing this post, the latest version of Apache Airflow is 2.6.3. On macOS, you can follow these steps:

Prerequisites #

  • Make sure you have Python installed on your system. Airflow is compatible with Python 3.7 and above.
  • It is recommended to set up a virtual environment to manage your Python dependencies.

Installation Steps:

Step 1: Create Project Directory #

Open your terminal and create a project folder:

mkdir -p ~/Desktop/Airflow-Local
cd ~/Desktop/Airflow-Local

Step 2: Set up the Python Virtual Environment #

Make sure to have your Python virtual environment set up and activated. terminal python virtual env activated in a project path

Step 3: Set AIRFLOW_HOME #

Set the AIRFLOW_HOME environment variable to the current project directory:

export AIRFLOW_HOME=~/Desktop/Airflow-Local

Step 4: Install Airflow with PIP #

Install Apache Airflow using pip, assuming you have Python 3.10 installed and want to install Airflow version 2.6.1:

pip install "apache-airflow==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"

Step 5: Start Airflow #

After the installation is complete, run the airflow standalone command to initialize the database, create a user, and start all components:

airflow standalone

You will see the login credentials in the log or the standalone_admin_password.txt file in the project directory.

screenshot of airflow log with admin login credentials

Step 6: Launch Airflow and Login #

You can now log in and access the Airflow web interface by opening a web browser and navigating to http://localhost:8080/.

screenshot of airflow running locally on Mac or Linux

That’s it! You should have successfully installed Apache Airflow on your macOS.

Now, it’s your turn. Do I cover everything you need to get Airflow running?

Let me know if you face any issues or any suggestions in the comment below.

Related Posts