Deploying on RPI with my own domain

Hi.

I am trying to deploy Streamlit app on my domain with IP http://213.168.184.217 where I host my webpages using nginx.
I am hosting the Streamlit app @ http://213.168.184.217:8501

I have no problem connecting my web via my domain url: www.mydevspace.cz
However I have not yet figured out how to host the Streamlit app @ www.mydevspace.cz:8501

How is this solved the best? I do not want users to access the app via ugly link http://213.168.184.217:8501/ and using href at my main page does not seem as an elegant solution.

Does anyone know?

Goddamit I’ve just figured out.
It really is as easy as this:

  1. create config.toml in .streamlit

inside the file put:

[server]
headless = true

[browser]
serverAddress = “www.mydevspace.cz”

4 Likes

Ohh man please help me through this, I have done what you said but I can see www.name.cm:8051…
But it is not responding in the browser.
Thanks in advance.

I found the solution on how to use the custom domain name. You can configure your apps to port 80 instead of using the streamlit default port 8051.

  1. modify .streamlit\config.toml
    [server]
    headless = true
    port = 80
    [browser]
    serverAddress = “www.name.cm”

  2. Run command: streamlit run your_script.py --server.port 80

  3. Open web www.name.cm

1 Like

It’s usually better to configure a proxy with nginx to make a better security layer on top of your streamlit app.

In that case your domain name is pointing to your rpi router (check dns like cloudflare), then is blocked by nginx (you can also add an auth step) and then redirect to your streamlit app.

I’m not a security expert or network expert, but I read a lot of times that exposing app ports directly to internet was not really recommended.

2 Likes