Aptible PaaS logoDocs

Python + Flask - Demo App

Deploy our Python demo app using the Flask framework with Managed PostgreSQL Database and Redis instance


The following guide is designed to help you deploy an example app on Aptible. During this process, Aptible will launch containers to run a Python app with a web server, a background worker, a Managed PostgreSQL Database, and a Redis instance.

The Demo App

The demo app displays the last 20 messages of the database, including any additional messages you record via the "message board." The application was designed to guide new users through a "Setup Checklist" which showcases various features of the Aptible platform (such as database migration, scaling, etc.) using both the dashboard and Aptible CLI.

See a live example of the application here.

Deploy App

⚠️ Prerequisite: Ensure you have Git installed.

Using the Deploy Code tool in the Aptible Dashboard, you can deploy the Deploy Demo App. The tool will guide you through the following:

Step 01: Deploy with Git Push

Step 02: Add an SSH key

If you have not done so already, you will be prompted to set up an SSH key.

Step 03: Environment Setup

Select your stack to deploy your resources. This will determine what region your resources are deployed to. Then, name the environment your resources will be grouped into.

Step 04: Prepare the template

Select Deploy Demo App for deployment, and follow command-line instructions.

Step 05: Fill environment variables and deploy!

Aptible will automatically fill this template's app configuration, services, and required databases. This includes: a web server, a background worker, a Managed PostgreSQL Database, and a Redis instance. All you have to do is fill the complete the environment variables save and deploy the code!

Step 06: View logs in real time

Step 07: Expose your app to the internet

Now that your code is deployed, it's time to expose your app to the internet. Select the service that needs an endpoint, and Aptible will automatically provision a managed endpoint.

Step 08: View your deployed app 🎉

View the deployed app and optionally test the message board and/or "Setup Checklist"

Next steps

Continue your journey on Aptible: