Custom domain for Streamlit Sharing

Maybe I missed this but I couldn’t find anything: Is it possible to use a custom domain name for Streamlit Sharing? This would be absolutely vital for me to deploy my Traingenerator app on Sharing.

7 Likes

This is on our roadmap @jrieke. One thing I believe I have seen doing right now are people iframing their Sharing app into essentially a blank page on their domain.

8 Likes

Intersting, do you have an example at hand?

Hi @jrieke and @chris_klose , here is how I iframed my App: Periodic Table demo

I use the fast Gatsby-framework, but you can do this anywhere:

<iframe src='https://share.streamlit.io/innerdoc/periodic-table-creator/main/periodic-table-creator/periodic_table_creator.py' height="1000" width="100%"></iframe>

5 Likes

An extension of previous answers, an option I am using, if Streamlit Sharing from Github (& just own a domain and not hosting):

  1. Turn on Github Pages for repo
  2. Put file index.html in root of your repo:
    <!DOCTYPE html>
    <html>
    <head>
    	<title>Your app name</title>
    	<style type="text/css">
    		html {
    			overflow: auto;
    		}  		
    		html,
    		body,
    		div,
    		iframe {
    			margin: 0px;
    			padding: 0px;
    			height: 100%;
    			border: none;
    		}	
    		iframe {
    			display: block;
    			width: 100%;
    			border: none;
    			overflow-y: auto;
    			overflow-x: hidden;
    		}
    	</style>
    </head>
    <body>
    	<iframe src="<your streamlit app url>"
    			frameborder="0"
    			marginheight="0"
    			marginwidth="0"
    			width="100%"
    			height="100%"
    			scrolling="auto">
    </iframe>
    </body>
    </html>
  1. Set custom domain for GitHub Pages
10 Likes

Takes a while for the index.html file to load. Don’t be put off if you get the 404 error. Just be patient.

Thanks for this solution!

1 Like

Does this still work? I can’t use it and I think that streamlit does not allow iframe-ing it anymore. Can you please confirm whether this solution is still working? Thanks!

Hi @randyzwitch , I think the custom domain feature can attract more new users to use the app, any update on this? thanks! :blush:

4 Likes

This works, but unfortunately the page isn’t responsive, so it doesn’t look good on mobile devices. Is there any way to fix that?

1 Like

any update on custom domain names for Cloud apps? this is a must have.

2 Likes

No News from this post yet?

Quick update (kinda strange to answer on my own post lol): We are working on subdomains per app right now (see here in our roadmap app), which will be a precursor for completely custom domains!

1 Like

Hey !! Thanks for the roadmap! But on the meantime I saw that you added a name to your streamlit page, how did you achieve this? Can you share it with us please? thanks in advance!

Hi @Jon_Robinson I tried this solutions and the redirect worked without any problem, but the login did not work https://analytics.houm.com/ this is the url of my app, I am using streamlit cloud with Github Pages and Custom DNS.

I got a 403 error code.

Hi everyone! Is there any update for the custom domain feature?

We can set a custom subdomain for Streamlit Cloud, but not a different top-level domain at this time. If you want a different top-level domain, you’d have to use some manner of frame or redirect as mentioned above.

1 Like

Ohh I understand. Thanks you so much for the information!

1 Like

Any update on using a custom top-level domain? This would be a great addition!

I don’t think there will be any updates on that. If you have a domain and a web server, you can embed your app in a web page.

Got it! Thank will work. Thank you!