Does Gunicorn run on Windows
Asked Answered
C

7

120

I have looked around for a while, and I was surprised not finding any information whether Gunicorn runs on Windows or not. Does anyone know if that is the case, and if so, where can I find some documentation about it?

Centi answered 18/6, 2012 at 17:8 Comment(2)
I'm looking for the closest alternative to Gunicorn for Windows. Any suggestions?Unplaced
I'm using waitress now, very good alternative :)Unplaced
U
187

Technically this is not an answer. But practically the answer I was looking for is how to run a WSGI web app (like Django) on Windows, and for those who got into this page because of that, here it is:

I'm using waitress now, very good alternative :)

Basically all you have to do is replace the gunicorn call with:

waitress-serve --listen=*:8000 myapp.wsgi:application

For typical apps this will give you the same result as running gunicorn. :) Good luck!

Unplaced answered 31/1, 2018 at 12:18 Comment(2)
Perfectly working for me without having to change any other code, thanks! Though I ended up using waitress.serve(app, listen='0.0.0.0:5003') where 5003 is my custom port and app is app = Flask(__name__)Stipendiary
anyone trying to deploy to heroku, try web: waitress-serve --port=$PORT myapp.wsgi:application(inside Procfile), before pushing to heroku master. Use Hendy's answer ,i.e specify a port, if you are trying on heroku localPegg
N
93

Gunicorn is for a UNIX environment and is incompatible with Windows. Also for more info please refer to it's docs.

Nyberg answered 18/6, 2012 at 17:15 Comment(2)
See my answer below, cygwin support is not far awayAlarcon
Gunicorn states that clearly, but all of the Uvicorn documentation does not mention the Linux requirement on github, pypi, or uvicorn.com.Rani
F
27

Edit: there's now a plan to add Windows support. https://github.com/benoitc/gunicorn/issues/524


No. Gunicorn doesn't run on Windows. It's very design is to take 'advantage of features in Unix/Unix-like kernels'.

Franzoni answered 13/12, 2012 at 20:53 Comment(0)
A
10

gunicorn used not to run directly on Windows, but work (and pending issues being resolved) mean that you can make it work on Cygwin.

See https://github.com/benoitc/gunicorn/issues/407 ....

(Note: I update this answer because the bug has now been fixed)

Alarcon answered 23/12, 2012 at 9:43 Comment(1)
Using the Windows Subsystem for Linux (WSL) on Windows 10 is a valid alternative to Cygwin (if not better) nowadays.Cozenage
H
6

Gunicorn does not support windows, although you can use waitress

Heeltap answered 10/6, 2019 at 9:22 Comment(0)
R
5

I'm trying to Build ASGI app on windows using FASTAPI. FASTAPI is run on Gunicorn & Uvicorn server.I read the FASTAPI documentation to find out how to deploy my app on windows. They suggesting to use docker to deploy the app from windows. It turns out to be the best way to use Gunicorn on windows.

Randolph answered 13/9, 2020 at 3:19 Comment(0)
K
4

On Windows, you can install guvicorn like that:

pip install uvicorn gunicorn

And then, run your server using the notation available in https://www.uvicorn.org/. Example:

uvicorn myproject.asgi:application --host 127.0.0.1 --port 80 --reload

It's how I use in production and it's being consistent to serve my Django ASGI applications.

Knob answered 23/9, 2022 at 16:17 Comment(1)
How to run uvicorn in daemon mode on windows?Jeramie

© 2022 - 2024 — McMap. All rights reserved.