Skip to content


Deploy your application with uWSGI and Nginx on Ubuntu

Ubuntu is a GNU/Linux operating system that can run the Web Application Server uWSGI and the Web Server Nginx.

Ubuntu versions below 20.04

In versions before Ubuntu 20.04, the pre-installed Python versions are older than 3.8, the oldest version supported by Taipy. If you are in that case, please install Python 3.8 or above.

Prepare your machine

The following software should be installed on your target machine:

  • pip: for installing Python3 packages.

  • uwsgi and gevent: the web application server and its workers that will run the Taipy applications.

  • nginx: the web server for the Internet exposition.

You can install all of these packages by running the following command:

sudo apt update -y
sudo apt install -y python3-pip nginx
sudo pip install uwsgi gevent
sudo ln -s `pwd`/.local/bin/uwsgi /usr/bin/uwsgi


If you are using a SQL database based on Microsoft SQL Server, you need to install your corresponding Microsoft ODBC Driver for SQL Server.

Run the application locally

If you want to deploy the following application:

from taipy import Gui

Gui(page="# Getting started with *Taipy*").run()

This would be placed in a file called
You need to create a requirements.txt file that contains:


On your local machine, start the application by executing the following:

$ pip install -r requirements.txt
Collecting taipy
<-- Truncate -->
Successfully installed taipy
 * Server starting on
 * Serving Flask app 'Taipy' (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
<-- Truncate -->

The application is running locally; you can access it with the browser on the URL


The message:

WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
may be issued by Flask because exposing an application on the Internet and developing an application locally have different requirements, mainly regarding security and reliability.
This message is generated by the Werkzeug WSGI web application library that Flash depends on and will disappear when using the web server.
Some versions of Werkzeug may even raise an exception in that situation, preventing you from running the application. You will then need to set the allow_unsafe_werkzeug configuration parameter to True (or set the allow_unsafe_werkzeug parameter of to True).

Prepare the application for deployment

Deploying your application to a remote environment needs a bit of configuration.

Make sure you turn off the Debug mode (which is the default) by setting the debug parameter of to False.
You must also inform Taipy not to run the application server on its own but rather delegate the execution by setting the parameter run_server of the call to to False.
The name of the variable where the web application is stored is used in the uWSGI configuration: this allows the web server to load the web application:

from taipy import Gui

gui_service = Gui(page="# Getting started with *Taipy*")
web_app =, run_server=False)
In our example, we store this application in the variable web_app (see line 3)

Make sure you upload this code on your target machine and install your dependencies with pip.

Entry point

The entry point filename and the application variable name are important for the proper configuration of the uWSGI web application server. Please, keep them as is or adapt the configuration.

uWSGI application server

To expose your application over the Internet, you must use uWSGI instead of Flask as the application server. You would then leverage Nginx to expose the application.

uWSGI can be started manually. But, generally, it's better to start the application automatically when the machine starts. To order to do that, you should use Systemd which is installed by default on Ubuntu.

From the directory where is located, run the following command to generate an adapted file for Systemd:

echo """

ExecStart=uwsgi --http --gevent 1000 --http-websockets --module app:web_app

""" > app.uwsgi.service
Then transfer this file to the correct folder by executing:
sudo mv app.uwsgi.service /etc/systemd/system/app.uwsgi.service

Now, you can start your application automatically at startup time of your machine by issuing the following commands:

sudo systemctl start app.uwsgi.service
sudo systemctl enable app.uwsgi.service

The application is now running locally but is not accessible yet from the Internet.

Exposing to the Internet

To expose your application on the Internet, you should use Nginx. Change the content of /etc/nginx/sites-enabled/default with the following:

server {
    listen 80;
    location / {
        proxy_pass http://localhost:5000;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Host $host;
Then restart Nginx:
sudo systemctl restart nginx

Your application is now accessible over the Internet!

HTTPS support

This configuration is only for HTTP. If you need an HTTPS connection, please read the Nginx documentation.