Installing uWSGI

Installing from a distribution package

uWSGI is available as a package in several OS/distributions.

Installing from source

To build uWSGI you need Python and a C compiler (gcc and clang are supported). Depending on the languages you wish to support you will need their development headers. On a Debian/Ubuntu system you can install them (and the rest of the infrastructure required to build software) with:

apt-get install build-essential python

And if you want to build a binary with python/wsgi support (as an example)

apt-get install python-dev

On a Fedora/Redhat system you can install them with:

yum groupinstall "Development Tools"
yum install python

For python/wsgi support:

yum install python-devel

If you have a variant of make available in your system you can simply run make. If you do not have make (or want to have more control) simply run:

python --build

You can also use pip to install uWSGI (it will build a binary with python support).

# Install the latest stable release:
pip install uwsgi
# ... or if you want to install the latest LTS (long term support) release,
pip install

Or you can use ruby gems (it will build a binary with ruby/rack support).

# Install the latest stable release:
gem install uwsgi

At the end of the build, you will get a report of the enabled features. If something you require is missing, just add the development headers and rerun the build. For example to build uWSGI with ssl and perl regexp support you need libssl-dev and pcre headers.

Alternative build profiles

For historical reasons when you run ‘make’, uWSGI is built with Python as the only supported language. You can build customized uWSGI servers using build profiles, located in the buildconf/ directory. You can use a specific profile with:

python --build <profile>

Or you can pass it via an environment variable:

# ... or even ...
UWSGI_PROFILE=gevent pip install uwsgi

Modular builds

This is the approach your distribution should follow, and this is the approach you MUST follow if you want to build a commercial service over uWSGI (see below). The vast majority of uWSGI features are available as plugins. Plugins can be loaded using the –plugin option. If you want to give users the maximum amount of flexibility allowing them to use only the minimal amount of resources, just create a modular build. A build profile named “core” is available.

python --build core

This will build a uWSGi binary without plugins. This is called the “server core”. Now you can start building all of the plugins you need. Check the plugins/ directory in the source distribution for a full list.

python --plugin plugins/psgi core
python --plugin plugins/rack core
python --plugin plugins/python core
python --plugin plugins/lua core
python --plugin plugins/corerouter core
python --plugin plugins/http core

Remember to always pass the build profile (‘core’ in this case) as the third argument.