Hosting on digitalocean

Hey y’all :raising_hand_man:

On my Ubuntu instance on digitalocean, if I run the following:

streamlit hello --browser.serverAddress dharmatech.dev --browser.serverPort 8502

I can get to the site via IP:

http://24.199.124.110:8502/

Here’s what it looks like:

However, if I try to load via the name provided:

http://dharmatech.dev:8502/

I get the following:

The name ‘dharmatech.dev’ resolves to the above IP address.

Any suggestions are welcome!

Ed

OK, it looks like this has something to do with newer browsers and SSL…

If I test using Brave 1.62, the site works!

However, it doesn’t load in Brave 1.63.

Similar with Firefox. The site loads in Firefox 121:

However it times out in Firefox 122:

Here’s how I’m invoking the app:

streamlit hello --browser.serverAddress dharmatech.dev --browser.serverPort 8502

What’s a good way to run it on https?

If I run streamlit as follows:

streamlit hello \
    --browser.serverAddress dharmatech.dev \
    --browser.serverPort 8502 \
    --server.sslCertFile /etc/letsencrypt/live/dharmatech.dev/fullchain.pem \
    --server.sslKeyFile /etc/letsencrypt/live/dharmatech.dev/privkey.pem

It loads in a recent version of brave:

Note that I had to pass the fullchain.pem and privkey.pem files to streamlit so that http is enabled.

In order for streamlit to access the ssl files, I had to run it as root, which isn’t recommended. :sweat_smile:

See this answer for how to allow normal users access to the ssl files:

1 Like

OK, I got streamlit working with the following setup:

See this post for the configuration details:

1 Like

Hi @dharmatech I can’t give you specific help on DigitalOcean but my experience on Render has been excellent.

I have written detailed instructions on how to easily deploy on Render in another post.

It looks quite long but makes sense if you read the concepts.

1 Like

Thank you for sharing! :+1:

You’re welcome. I’m sorry I couldn’t be more specific with digital ocean.

1 Like