Airflow Installation on Windows

An approach for Apache Airflow Setup

Well, airflow can’t work on windows directly. I was not able to run airflow with docker as well. Now what? I am sharing a possible way to get airflow working on windows, that worked for me.

Setup Windows Subsystem for Linux

  1. Turn Window Subsystem For Linux
    a. Setting >> Apps >> “Related settings”
    b. Click the Programs and Features option
    c. Click the Turn Windows features on or off option
    d. Check the Windows Subsystem for Linux option
Turn on WSL feature

2. Install Ubuntu Linux
a. Go to Microsoft Store
b. Install Ubuntu ( I downloaded from Canonical Group Limited)
c. Click on ‘Get’, ‘install’ after it is downloaded and finally ‘Launch’

Airflow Installation

  1. Setup of Ubuntu
    a. Setup user and password
    b. Upgrade and Update
  2. Install Airflow
    a. Activate sudo access and enter password
    b. Check for pip and install pip if not present
    c. install Install Airflow
>> apt-get update
............
............
>> apt-get upgrade
............
............
>> sudo su
password:
>> pip -V
Either pip version or Error if not installed
>> apt install python3-pip
>> pip install apache-airflow

Airflow Setup

Won’t still be able to access airflow localhost webpage. By default, Airflow requires users to specify a password prior to login. To setup logins type the following after changing the specifics

airflow users create \
--username omrastogi\
--firstname Om\
--lastname Rastogi\
--role Admin \
--email omrastogi@gmail.com

Some Important cli commands

  1. airflow webserver
    To run the airflow webserver
  2. airflow scheduler
    To run the airflow scheduler, a new dag won’t be added until scheduler is not run
  3. airflow dag list
    To check the list of all dags and their repository
  4. airflow dags unpause <dag name>
    To start/resume the dag
  5. airflow dags test <dag name><date>
    To test a dag on a given date

It took me a lot of time to figure out each step, aforementioned are the things that worked well for me, hope they will work for you as well.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Om Rastogi

Om Rastogi

I believe in an altruistic world, where creativity and imagination replace repetitive work