Cloud VPS from $1.98/mo · pay with Bitcoin, Ethereum, Monero, USDT or Solana · paid in crypto
DevelopmentEditor's pick

Flask on a VPS

Flask is a small Python web framework built on Werkzeug and Jinja. Start with one file, add extensions as you need them, and run it on a server you control.

512 MBMinimum memory
Ubuntu 24.04 LTSBase image
80/tcp, 443/tcp, 5000/tcpPorts
BSD-3-ClauseLicense

About Flask

Flask is a BSD-licensed WSGI framework that began as a thin layer over Werkzeug and Jinja. A single file with one route is a working app, while blueprints, a Click-based CLI and a large extension ecosystem carry it to bigger projects without imposing a structure.

Python web apps run well on a modest Cloud VPS, and DDR5 memory leaves room for several Gunicorn workers. With root access you choose the Python version, WSGI server and proxy, and hourly billing suits short-lived test servers.

You start from Ubuntu 24.04 LTS, Python and Flask, with nothing else in the way of your code.

What you get with Flask

  • Routing and request handling from Werkzeug
  • Jinja templates with autoescaping
  • Blueprints to split large apps into modules
  • A flask command line built on Click
  • Extensions for databases, auth, forms and more

Flask use cases

  • Small web apps and admin tools
  • JSON APIs and webhook endpoints
  • Prototypes that may grow into products

After you deploy Flask

  1. With the server Running, connect over SSH as root and make a virtual environment for your project.
  2. Try it with flask --app app run --host 0.0.0.0 and open http://<server IP>:5000; the built-in server is for development only.
  3. For production, install Gunicorn and run gunicorn -w 4 'app:app' under a systemd unit.
  4. Put Nginx in front with your domain and HTTPS, proxying to Gunicorn on port 8000.

Flask ports

Open these in your firewall if you use one: 80/tcp HTTP, 443/tcp HTTPS, 5000/tcp dev server.

Flask FAQ

Can I use the Flask development server in production?

No. Flask's documentation says it is not designed for production. Use a WSGI server such as Gunicorn, Waitress or uWSGI behind Nginx, and keep port 5000 closed to the internet.

Does Flask support async views?

Yes, async def views work after installing the flask[async] extra, but Flask remains a WSGI framework. For mostly asynchronous workloads, an ASGI framework such as FastAPI may fit better.

Disclaimer. The Flask project has no affiliation with CloudSat and does not endorse it. Names and logos belong to their owners and appear only to identify the software.

Flask on your own server.
Ready in under 5 minutes.

Pick a region and a size; the console shows the address as soon as it is up.

Every server delivered in under 5 minutesPay with crypto14-day money-back