Flask's built-in server is not suitable for production. You need to use a production WSGI server like Gunicorn or uWSGI behind a reverse proxy like Nginx. Gunicorn Deployment Install Gunicorn: pip install gunicorn Run your app: gunicorn -w 4 -b 127.0.0.1:4000 app:app Setup Nginx to reverse proxy to port 4000.