Skip to content

Commit

Permalink
#46316 Issue: Update start.rst (#46335)
Browse files Browse the repository at this point in the history
* #46316 Issue: Update start.rst

* Update start.rst

Added the link for detailed error

* Removed single ticks
  • Loading branch information
SaumilPatel03 authored Feb 5, 2025
1 parent a057b95 commit 0a3eb17
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions docs/apache-airflow/start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This quick start guide will help you bootstrap an Airflow standalone instance on

.. note::

Successful installation requires a Python 3 environment. Starting with Airflow 2.7.0, Airflow supports Python 3.9, 3.10, 3.11 and 3.12.
Successful installation requires a Python 3 environment. Starting with Airflow 2.7.0, Airflow supports Python 3.9, 3.10, 3.11, and 3.12.

Only ``pip`` installation is currently officially supported.

Expand All @@ -44,15 +44,36 @@ This quick start guide will help you bootstrap an Airflow standalone instance on
The installation of Airflow is straightforward if you follow the instructions below. Airflow uses
constraint files to enable reproducible installation, so using ``pip`` and constraint files is recommended.

1. Set Airflow Home (optional):
1. **(Recommended) Create and Activate a Virtual Environment**:

To avoid issues such as the ``externally-managed-environment`` error, particularly on modern Linux distributions like Ubuntu 22.04+ and Debian 12+, it is highly recommended to install Airflow inside a Python virtual environment. This approach prevents conflicts with system-level Python packages and ensures smooth installation.

For more details on this error, see the Python Packaging Authority's explanation in the `PEP 668 documentation <https://peps.python.org/pep-0668/>`_.

.. code-block:: bash
# Create a virtual environment in your desired directory
python3 -m venv airflow_venv
# Activate the virtual environment
source airflow_venv/bin/activate
# Upgrade pip within the virtual environment
pip install --upgrade pip
# Optional: Deactivate the virtual environment when done
deactivate
2. **Set Airflow Home (optional)**:

Airflow requires a home directory, and uses ``~/airflow`` by default, but you can set a different location if you prefer. The ``AIRFLOW_HOME`` environment variable is used to inform Airflow of the desired location. This step of setting the environment variable should be done before installing Airflow so that the installation process knows where to store the necessary files.

.. code-block:: bash
export AIRFLOW_HOME=~/airflow
2. Install Airflow using the constraints file, which is determined based on the URL we pass:
3. Install Airflow using the constraints file, which is determined based on the URL we pass:

.. code-block:: bash
:substitutions:
Expand All @@ -69,15 +90,15 @@ constraint files to enable reproducible installation, so using ``pip`` and const
pip install "apache-airflow==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"
3. Run Airflow Standalone:
4. Run Airflow Standalone:

The ``airflow standalone`` command initializes the database, creates a user, and starts all components.

.. code-block:: bash
airflow standalone
4. Access the Airflow UI:
5. Access the Airflow UI:

Visit ``localhost:8080`` in your browser and log in with the admin account details shown in the terminal. Enable the ``example_bash_operator`` DAG in the home page.

Expand Down

0 comments on commit 0a3eb17

Please sign in to comment.