Make an airflow folder by issuing this command mkdir airflow in your home directory
mkdir airflow
Create the airflow home environment variable
export AIRFLOW_HOME=~/airflow
Add the variable in ~/.bashrc file so the environment variable will stay after reboot
Next, run the below command to apply new changes within the file '~/.bashrc'.
source ~/.bashrc
Install Apache Airflow
Now let’s install apache-airflow by using python PIP
sudo pip3 install apache-airflow
Now, let’s initialize the airflow database by issuing airflow db init
fcolomer@puzzle:~/airflow$ airflow db init
DB: sqlite:////home/fcolomer/airflow/airflow.db
[2023-06-07T12:31:33.888+0200] {migration.py:213} INFO - Context impl SQLiteImpl.
[2023-06-07T12:31:33.890+0200] {migration.py:216} INFO - Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Running stamp_revision -> 98ae134e6fff
WARNI [airflow.models.crypto] empty cryptography key - values will not be stored encrypted.
Initialization done
The next step is to create an admin user:
airflow users create --role Admin --email your@email.org -u username -p xxxx -f First -l Last
Now it is time to launch Airflow. First, we need to launch the airflow scheduler in background: