Custom domain name

Hello everybody!

Does streamlit support custom domain name of apps? After deploying an app instead of having share.streamlit.io/gitRepo can I have my own domain name? Thanks!

You can deploy your app on heroku.com and heroku has an option to use a custom domain in settings. To deploy an app on heroku you have to add two files to your repo on github.


setup.sh

mkdir -p ~/.streamlit/

echo "
[server]\n
headless = true\n
port = $PORT\n
enableCORS = false\n
\n
" > ~/.streamlit/config.toml


Procfile

web: sh setup.sh && streamlit run YourAppNameHere.py


Just change the app name in the Procfile. The rest is a copy paste

2 Likes

MaxMnemo
Huge thank you! You are my life-saver!
Any idea how I can setup the secrets.toml (has passwords) file from streamlit to be read in heruko without pushing it in git as it has sensitive info? I saw that in heruko there is config vars where I can setup sensitive variables but I was wondering if there is a way to directly take it secrets.toml

Hi @ngocuong0105 ,

you can you Heroku environment variables to store the secrets
Configuration and Config Vars | Heroku Dev Center

and then read them within streamlit, like this

import os
DB_PSSWD = os.environ.get('DB_PSSWD')

Thanks,
Akshansh

3 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.