Installation

mod_wsgi can be installed in several ways. The right choice depends on what you want to run, who manages the host, and which platform you are on.

For the full requirements list (Python and Apache versions, build toolchain, distribution package names) see Requirements.

Choosing an install method

  • Want to try mod_wsgi quickly, or run it inside a Python virtual environment alongside your application’s other dependencies? Install from PyPI with pip install mod_wsgi. This also gives you the mod_wsgi-express admin command for running a private Apache plus mod_wsgi instance from the command line. See Installation From PyPI.

  • Running on Linux and want a system-wide install managed by your distribution’s package manager? Install the distribution package. See Installation On Linux.

  • Want a from-source build that installs into Apache the traditional way? A configure / make / make install flow. See Installation From Source.

Choosing a runtime shape

How mod_wsgi runs your application is a separate choice from how it is installed:

  • Embedded and Daemon Mode — embedded mode runs WSGI inside Apache worker processes; daemon mode runs it in separate mod_wsgi-managed processes that Apache forwards requests to. Daemon mode is the usual choice.

  • Running Behind A Reverse Proxy — running mod_wsgi behind nginx, a load balancer, or another HTTP front-end.

  • Running mod_wsgi-express — for PyPI installs, mod_wsgi-express provides a single command-line interface that wraps both modes.

Platform-specific notes

  • Installation On macOS — Apple removed the build tooling needed to use the system Apache, so macOS uses an Apache installed via Homebrew.

  • Installation On Windows — Windows install is via pip only; daemon mode and mod_wsgi-express start-server are not available on Windows.

Notes on currency

The version of mod_wsgi shipped by your Linux distribution may lag the current upstream release; long-term-support distributions in particular can lag upstream by some time. The age and currency of the packaged version varies by distribution and release. Check the version your distribution provides; if security currency or access to recent fixes matters for your deployment, weigh that against installing from PyPI or from source. See Project Status for the project’s overall version support policy.

After installing