Custom domain for Streamlit Sharing

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