0
0
Apache Airflowdevops~30 mins

Installing Airflow locally - Try It Yourself

Choose your learning style9 modes available
Installing Airflow locally
📖 Scenario: You want to run Apache Airflow on your own computer to practice scheduling and managing workflows. This project will guide you step-by-step to install Airflow locally using the recommended commands.
🎯 Goal: By the end, you will have Apache Airflow installed and ready to use on your local machine.
📋 What You'll Learn
Have Python 3.7 or higher installed
Have pip installed
Use a terminal or command prompt
💡 Why This Matters
🌍 Real World
Developers and data engineers often install Airflow locally to test and develop workflow automation before deploying to production.
💼 Career
Knowing how to install and run Airflow is a key skill for roles involving data pipeline management and workflow orchestration.
Progress0 / 4 steps
1
Create a new directory for Airflow
Open your terminal and create a new directory called airflow_home using the command mkdir airflow_home. Then change into this directory using cd airflow_home.
Apache Airflow
Need a hint?

Think of this like making a new folder on your computer and then opening it.

2
Set the Airflow home environment variable
Set the environment variable AIRFLOW_HOME to the current directory by running export AIRFLOW_HOME=$(pwd) on Linux/macOS or set AIRFLOW_HOME=%cd% on Windows.
Apache Airflow
Need a hint?

This tells Airflow where to store its files, like setting a workspace.

3
Install Apache Airflow using pip
Run the command pip install apache-airflow==2.7.1 --constraint https://raw.githubusercontent.com/apache/airflow/constraints-2.7.1/constraints-3.7.txt to install Airflow version 2.7.1 with the correct dependencies.
Apache Airflow
Need a hint?

This command installs Airflow and ensures all needed packages match the version.

4
Initialize the Airflow database and start the webserver
Run airflow db init to initialize the Airflow database. Then start the Airflow webserver by running airflow webserver --port 8080. This will start the Airflow interface on your local machine.
Apache Airflow
Need a hint?

Initializing the database sets up Airflow's internal storage. Starting the webserver lets you see Airflow in your browser.