IRAF – Image Reduction and Analysis Facility is a product of the National Optical Astronomy Observatory (NOAO).
It has been widely used in the astronomical community for reducing data in the form of images and spectra.
IRAF works best in UNIX-based distributions such as Ubuntu, Debian, or Fedora.
Step 1 – Check your system architecture
Before installing, find out if your operating system is 64-bit or 32-bit.
$ sudo -s # specify your user password
$ uname -m # shows 64-bit (x86_64) or 32-bit (i686)
Step 2 – Download the IRAF package
$ wget https://github.com/iraf-community/iraf/archive/refs/tags/v2.16.1+2021.06.14.tar.gz
The downloaded fileiraf-2.16.1-2021.06.14.tar.gz
will appear in your Downloads folder.
Move it to your preferred working directory (e.g., /home) and extract:
$ mv iraf-2.16.1-2021.06.14.tar.gz /home
$ tar -xvzf iraf-2.16.1-2021.06.14.tar.gz
$ mv /home/iraf-2.16.1-2021.06.14 /home/iraf
Step 3 – Install required packages
On Debian/Ubuntu/Mint/Devuan/Raspbian
$ sudo apt install gcc make flex
$ sudo apt install libcurl4-openssl-dev libexpat-dev libreadline-dev
On Fedora/Red Hat/Scientific Linux
$ sudo dnf install gcc make perl flex
$ sudo dnf install libcurl-devel expat-devel readline-devel
On macOS X
Install Xcode Command Line Tools (required to build from source):
Navigate to the IRAF folder and execute the installer:

The current IRAF version is 2.18.1, see the original installation instructions at https://iraf-community.github.io/install.html
One additional note here: IRAF is packaged for Debian and its derivatives (Ubuntu, Mint, …). On these systems it can be easily installed with the command “sudo apt install iraf”.
Thank you for the update! Would you know how we could install it in Windows or a Windows subsystem in Linux?
The simplest way is to use Debian or Ubuntu in the Windows Subsystem for Linux and do a “sudo apt install iraf” there.