Quickstart: Deploy a Flask App
This guide will walk you through deploying a production-ready Flask application on Seenode. We’ll use Gunicorn as our production WSGI server.
Deploy a Flask Template
Section titled “Deploy a Flask Template”Get started in seconds by deploying a pre-built Flask template.
Flask Template
Deploy a minimal, production-ready Flask application with Gunicorn.Deploying an Existing Flask Project
Section titled “Deploying an Existing Flask Project”Follow these steps to deploy your existing Flask application from a Git repository.
-
Prepare Your Flask App
Ensure your project is configured for production.
Project Structure
Your project should have an
app.py
file and arequirements.txt
.Directorymy-flask-app/
- app.py
- requirements.txt
Example
app.py
Seenode will look for an
app
instance in yourapp.py
file.app.py from flask import Flaskapp = Flask(__name__)@app.route("/")def hello_world():return "Hello, from Seenode!"requirements.txt
Your
requirements.txt
should includeflask
. For production, we also recommend a WSGI server likegunicorn
.requirements.txt flaskgunicorn -
Deploy on Seenode
Follow these steps to deploy your Flask application:
-
From the Seenode Dashboard, create a New Web Service, connect your Git provider, and select your Flask project’s repository.
-
Configure your service’s settings. For a typical Flask app, you can use the following:
- Build Command:
pip install -r requirements.txt
- Start Command:
gunicorn app:app --bind 0.0.0.0:8000
- Build Command:
-
Choose your preferred instance size and create the service.
-
Watch your deployment progress in real-time in the Logs tab.
-
Once complete, your application will be accessible via your service’s URL.
-
Next Steps
Section titled “Next Steps”Now that your Flask app is deployed, here are some recommended next steps:
Set up a Custom Domain (Coming Soon)
Configure a custom domain to point to your new web service.Connect to a Database
Instantly scaffold and connect PostgreSQL and MySQL databases