Running Streamlit inside JupyterHub

How to run a Streamlit app in place of the regular Jupyter notebook server, so your JupyterHub provides an authentication layer around the Streamlit app

Dan Lester
The Startup

--

Streamlit is a great framework for building beautiful data science web apps and prototypes, but the data scientist is largely left to their own devices when it comes to deploying the app to non-technical users.

Many organisations already have the capability to run a JupyterHub — which brings many options for authentication, such as single-sign-on through corporate email accounts. That makes JupyterHub a great base for hosting Streamlit apps. The flexibility of JupyterHub means that, with the right configuration, it doesn’t really mind what you run as the underlying ‘notebook’ server!

Installing JupyterHub

There are a few different ways to install JupyerHub for your organisation. The distributions are described here. For a nice standardised single-server setup, you will do well with The Littlest JupyterHub (TLJH). This has a simple command line tool to easily set up HTTPS certificates and other configuration, but has some important base requirements on your server.

I’ll mostly assume you are going with TLJH, but steps for your own manual installation will be similar.

The initial installation and setup of TLJH is described for various cloud providers (or your…

--

--