Host a Dashboard using Python, Dash, and Linux in your own Linux server

Hosting a Dash app on Ubuntu 20.04 using uWSGI and Nginx

Why Host a Dashboard?


Get down to it

Dashboard App

Check your app works


Install and prepare uWSGI

conda install -c conda-force uwsgi


from app import server as application
if __name__ == '__main__':
uwsgi --socket --protocol=http -w wsgi

Create index.ini

nano index.ini
module = wsgi
master = true
processes = 4
socket = index.sock
chmod-socket = 660
vacuum = true
die-on-term = true

Create Index.service Systemd Unit File

nano /etc/systemd/system/index.service
Description=uWSGI instance to serve index
ExecStart=/home/carpiero/miniconda3/envs/server_env/bin/uwsgi --force-cwd /home/carpiero/ir/DataTown --ini index.ini
WantedBy =
sudo systemctl restart index.service
sudo systemctl status index.service

Configure Nginx

sudo nano /etc/nginx/sites-available/datatown
server { server_name;if ($host = { 
return 301$request_uri;
location / {
include uwsgi_params;
uwsgi_pass unix:/home/carpiero/ir/DataTown/index.sock;

That’s it

💻 Data Analyst | 📊 MBA | 🤖 Machine Learning | 📈 Controller

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store