Debian GNU/Linux
If you are using Debian GNU/Linux it is recommended that you use system packages to install Gunicorn except maybe when you want to use different versions of Gunicorn with virtualenv. This has a number of advantages:
- Zero-effort installation: Automatically starts multiple Gunicorn instances based on configurations defined in
/etc/gunicorn.d
. - Sensible default locations for logs (
/var/log/gunicorn
). Logs can be automatically rotated and compressed usinglogrotate
. - Improved security: Can easily run each Gunicorn instance with a dedicated UNIX user/group.
- Sensible upgrade path: Upgrades to newer versions result in less downtime, handle conflicting changes in configuration options, and can be quickly rolled back in case of incompatibility. The package can also be purged entirely from the system in seconds.
stable (“stretch”)
The version of Gunicorn in the Debian “stable” distribution is 19.6.0 (June 2017). You can install it using:
$ sudo apt-get install gunicorn
You can also use the most recent version by using Debian Backports. First, copy the following line to your /etc/apt/sources.list
:
deb http://ftp.debian.org/debian stretch-backports main
Then, update your local package lists:
$ sudo apt-get update
You can then install the latest version using:
$ sudo apt-get -t stretch-backports install gunicorn
oldstable (“jessie”)
The version of Gunicorn in the Debian “oldstable” distribution is 19.0 (June 2014). You can install it using:
$ sudo apt-get install gunicorn
You can also use the most recent version by using Debian Backports. First, copy the following line to your /etc/apt/sources.list
:
deb http://ftp.debian.org/debian jessie-backports main
Then, update your local package lists:
$ sudo apt-get update
You can then install the latest version using:
$ sudo apt-get -t jessie-backports install gunicorn
Testing (“buster”) / Unstable (“sid”)
“buster” and “sid” contain the latest released version of Gunicorn. You can install it in the usual way:
$ sudo apt-get install gunicorn