
Template details
Flask + Vercel
Minimal Flask example that runs a WSGI Python API on Vercel Serverless Functions using the Python Runtime.
About this template
Flask + Vercel is a boilerplate example from the vercel/examples collection that runs a Python Flask application as a Vercel Serverless Function through the Vercel Python Runtime. It ships a single Flask entry point and a one-click deploy button that clones the example into a new Vercel project.
What is Flask + Vercel?
Flask + Vercel is a starter example that wires a Python Flask app into Vercel's Serverless Functions using the Web Server Gateway Interface (WSGI). The template takes a standard Flask application (exposed as main:app) as input, serves it locally through Gunicorn during development, and produces a deployed HTTP API on Vercel. It is maintained inside the official vercel/vercel repository under examples/flask, and a live deployment is published at the demo URL https://vercel-plus-flask.vercel.app/.
What makes Flask + Vercel stand out?
- WSGI-based request handling — Flask's WSGI callable is adapted to Vercel Serverless Functions, so ordinary Flask routing and request/response objects work without rewriting the app.
- Vercel Python Runtime — the deployment targets the documented Python runtime for Serverless Functions rather than a container or custom server.
- Gunicorn local server —
gunicorn main:appboots the app locally, with the README noting it becomes available athttp://localhost:3000. - Dependency management via uv —
uv syncinstalls dependencies, withpip install flask gunicorndocumented as an alternative. - Vercel CLI workflow —
npm i -g vercelinstalls the CLI used to run and deploy the project. - Virtual environment setup — the documented flow creates and activates a
.venvbefore installing dependencies. - One-click deploy — a Deploy with Vercel link clones
github.com/vercel/vercel/tree/main/examples/flaskand pre-fills the demo title "Flask API" and demo URL.
Who should use this template?
- Python developers moving to serverless — anyone who wants to host an existing Flask API on Vercel without converting it to a different framework or packaging it in a container.
- Backend engineers prototyping JSON endpoints — teams that need a minimal API backend deployed quickly alongside a frontend hosted on Vercel.
- Developers evaluating the Vercel Python Runtime — users who want to confirm WSGI compatibility before migrating a larger Flask codebase.
- Vercel beginners — people looking for the shortest path from a clone command to a live Python URL.
What can you do with Flask + Vercel?
- Ship a Python API endpoint: clone the example and deploy it to get a live Flask-powered HTTP endpoint on a Vercel subdomain.
- Prototype serverless backends: extend
main:appwith additional Flask routes and redeploy through the Vercel CLI. - Test WSGI compatibility: verify that an existing Flask app's routing behaves the same when executed inside Vercel Serverless Functions.
- Run a local development loop: activate the
.venv, start Gunicorn, and develop against the same app object that gets deployed.
How does Flask + Vercel work?
- Install the Vercel CLI globally with
npm i -g vercel. - Create a virtual environment with
python -m venv .venvand activate it. - Install dependencies with
uv sync, or withpip install flask gunicorn. - Start the app locally with
gunicorn main:app, then deploy through Vercel or the one-click clone link.
FAQ
Is Flask + Vercel free to use?
The example is open source and published in the public vercel/vercel repository, so you can clone it at no cost. Deployment happens on Vercel's platform, which provides a free Hobby tier for personal projects; paid plans apply for higher usage and team features.
Does Flask + Vercel work with my existing Flask app?
It applies the Web Server Gateway Interface, so a standard Flask app object works. You point the runtime at your app import path (the example uses main:app) and keep your existing routes.
Can I install dependencies with pip instead of uv?
Yes. The README documents uv sync as the primary command and lists pip install flask gunicorn as an alternative, so either tool installs the Flask and Gunicorn dependencies needed to run locally.
What port does the local server use?
The documented local workflow runs Gunicorn via gunicorn main:app, and the README states the Flask application becomes available at http://localhost:3000.
Does Flask + Vercel include a frontend or database?
No. The example is limited to the Flask API and its serverless adaption; there is no bundled frontend, authentication, or database layer, so those pieces must be added separately.











