---
title: 'Flask — a Python Web Framework | Zomro'
description: 'Install Flask for rapid web application development in Python. A ready-to-use environment with routing, Jinja2 templates, and REST API.'
image: 'https://zomro.com/static/site/images/logo/logo-white.png?v=1796123538'
---

![opened image]()

  * [Zomro](https://zomro.com/)
  * [Marketplace](https://zomro.com/marketplace)
  * Flask 



![Flask icon](https://cdn.zomro.com/uploads/marketplace/instruction/flask_450_transparent.png)

# Flask

Version

3.0.2

OS

Ubuntu

[ deploy Flask ](https://cp.zomro.com/cart?name=Essential%20Intel&location=17&datacenter=17&dc=netherlands-3&period=1&category=shared_cpu&type=premium&isMarketplaceOrder=true&imageId=ffff16ca-de05-44f2-9bcc-f0bcbadc0138&id=7752&service=instances)

Flask is one of the simplest ways to write a web service in Python. There is no mandatory ORM, no imposed folder structure, and no dozens of dependencies "bundled in." You take what you need and build exactly the way you want. A REST API, a lightweight website, an internal corporate service, a prototype in a couple of hours - Flask handles all of these.

Setting up a production environment for Flask on your own takes time: Python, a virtual environment, Gunicorn, Nginx, proxy configuration, a systemd unit. A marketplace image deploys this standard environment in 1-2 minutes. Connect via SSH and it's already working.

## What you will need

  * An account with a VPS provider that has an image marketplace

  * A VPS with 1-2 vCPUs and 1-2 GB of RAM

  * A domain, if you plan to issue an SSL certificate




## Deploying a server from the marketplace

In the provider's marketplace, find the Flask image and click Deploy. Choose the configuration:

  * CPU: 1-2 vCPUs

  * RAM: 1-2 GB (enough for development and moderate load)

  * Disk: 20-40 GB SSD




Set a password or attach an SSH key, then click create. The server will be ready in 1-2 minutes.

## Connecting via SSH and viewing the application data

**Linux / macOS:**
    
    
    ssh root@SERVER_IP

**Windows - PowerShell or PuTTY:**
    
    
    ssh root@SERVER_IP

After logging in, the terminal will display a welcome message with information about the deployed application: the Flask version, the Python version, and commands for managing the service.

![Install Flask for rapid web application development in Python](https://cdn.zomro.com/uploads/blog/a48%40server-panel.net/2026/07/22/image_q50.jpg)

SSH login - a welcome message with the Flask version and management commands

The main commands for working with Gunicorn are also shown here:
    
    
    # Service status
    systemctl status gunicorn
    
    # Application logs
    journalctl -u gunicorn
    
    # Restart after code changes
    systemctl restart gunicorn

The application credentials are stored in the file `/root/.password_credentials`. View them with the command:
    
    
    cat /root/.password_credentials

![Install Flask for rapid web application development in Python](https://cdn.zomro.com/uploads/blog/a48%40server-panel.net/2026/07/22/image_TLb3C7K_q50.jpg)

Output of cat /root/.password_credentials - APP_PATH and APP_USER

The file contains:

  * **APP_PATH** \- the path to the Flask application directory

  * **APP_USER** \- the user under which the application runs




By default, the application is located in `/var/www/flask`.

## Opening the application in a browser

In your browser, go to the server's IP address:
    
    
    http://SERVER_IP

![Install Flask for rapid web application development in Python](https://cdn.zomro.com/uploads/blog/a48%40server-panel.net/2026/07/22/image_ofgExSi_q50.jpg)

Browser with the server address - Flask is running over HTTP

If an SSL certificate has not been set up yet, the site works over HTTP. The browser may show a warning - this is normal at the initial setup stage.

After opening the address, you will see the Flask start page. This is a template application that comes with the image - you can replace it with your own code right away.

![Install Flask for rapid web application development in Python](https://cdn.zomro.com/uploads/blog/a48%40server-panel.net/2026/07/22/image_o865lK9_q50.jpg)

The Flask start page in the browser - the template application is running

To host your own application, copy the files to the root directory `/var/www/flask` and restart Gunicorn:
    
    
    # Upload files via scp
    scp -r ./myapp/* root@SERVER_IP:/var/www/flask/
    
    # Restart the service
    systemctl restart gunicorn

## Issuing an SSL certificate

Before setting up SSL, make sure the domain points to the server's IP address. To do this, create an A record in DNS:
    
    
    A  yourdomain.com  →  SERVER_IP

Once the DNS record has propagated, run Certbot:
    
    
    certbot --nginx

The wizard will ask several questions:

  1. An email address for certificate expiration notifications

  2. Acceptance of the Let's Encrypt terms - enter `Y`

  3. The domain or subdomain for the certificate - enter it without `http://` and `www`




For example: `yourdomain.com` or `app.example.org`

![Install Flask for rapid web application development in Python](https://cdn.zomro.com/uploads/blog/a48%40server-panel.net/2026/07/22/image_RsgECvf_q50.jpg)

Certbot issues an SSL certificate - the interactive setup wizard

Certbot will find the Nginx configuration on its own, issue the certificate, and set up an automatic redirect from HTTP to HTTPS. Once it finishes, the site is available at `https://yourdomain.com`.

The certificate is valid for 90 days. Certbot renews it automatically via cron - you don't need to do anything manually.

## Application structure

The image deploys a standard Flask project structure:
    
    
    /var/www/flask/
    ├── app/
    │   ├── __init__.py      # Application factory
    │   ├── routes.py        # Routes
    │   └── templates/       # Jinja2 templates
    ├── run.py               # Entry point
    └── requirements.txt     # Dependencies

Nginx accepts incoming requests and proxies them to Gunicorn. Gunicorn runs Flask and operates as a systemd service. This combination is the standard for production environments in Python.

## Managing the application
    
    
    # Service status
    systemctl status gunicorn
    
    # Real-time logs
    journalctl -u gunicorn -f
    
    # Restart after code changes
    systemctl restart gunicorn
    
    # Stop / start
    systemctl stop gunicorn
    systemctl start gunicorn

When adding new dependencies, install them and restart:
    
    
    cd /var/www/flask
    pip install -r requirements.txt
    systemctl restart gunicorn

## What to set up next

Connect a database. Flask works with PostgreSQL via psycopg2 and SQLAlchemy, with MySQL via PyMySQL, and with Redis for caching. PostgreSQL is recommended for production workloads.

Set up monitoring. `journalctl -u gunicorn` covers basic needs, but for production it is useful to add alerts for service failures. Systemd can send an email when a unit stops abnormally.

Restrict access to the server. Block direct access to port 8000 (Gunicorn) in the firewall - it should be visible only from localhost, not from outside. Nginx listens on ports 80 and 443 and proxies traffic internally.

The marketplace image removes the routine of the initial deployment: Nginx, Gunicorn, and Flask are already configured and running. Replace the template with your own code, get an SSL certificate with a single command - and your application is ready to go.
