# Run streamlit in https mode

**URL:** <https://discuss.streamlit.io/t/run-streamlit-in-https-mode/2829>\
**Category:** Deployment\
**Tags:** https\
**Created:** [May 11, 2020, 3:15am UTC](https://discuss.streamlit.io/t/run-streamlit-in-https-mode/2829 "2020-05-11T03:15:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rakesh\_Ranjan](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/rakesh_ranjan/32/1633_2.png) [@Rakesh\_Ranjan](https://discuss.streamlit.io/u/Rakesh_Ranjan)\
**Post date:** [May 11, 2020, 3:15am UTC](https://discuss.streamlit.io/t/run-streamlit-in-https-mode/2829/1 "2020-05-11T03:15:10Z")

</div>

Hi, I wish to start streamlit as https and not the default http. Is there a way to do so passing the cert file path. I guess tornado supports it. If its not possible at all then is there a way that I create streamlit app and start the app via tornado server manually such that I can configure tornado to do so.

---

<div class="post-metadata">

**Author:** ![randyzwitch](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/randyzwitch/32/58772_2.png) [@randyzwitch](https://discuss.streamlit.io/u/randyzwitch)\
**Post date:** [May 15, 2020, 2:49pm UTC](https://discuss.streamlit.io/t/run-streamlit-in-https-mode/2829/2 "2020-05-15T14:49:14Z")

</div>

Hi @Rakesh_Ranjan, welcome to the Streamlit community!

There isn’t a whole lot of information about deploying Streamlit with https (which we have an open ticket to make some better examples), but this thread seems to have a couple of options how to deploy using https. Let me know if this helps you solve your problem.

> [@Streamlit, docker, Nginx, ssl/https](https://discuss.streamlit.io/t/streamlit-docker-nginx-ssl-https/2195/5):
>
> My nginx server stanza looks like this. Maybe try putting the proxy\_set… params outside of your location {…} stanzas. server { listen 443 ssl; server\_name localhost; ssl\_certificate C:/.../nginx/conf/certificate.pem; ssl\_certificate\_key C:/.../nginx/conf/key.pem; proxy\_http\_version 1.1; proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for; proxy\_set\_header Host $host; # streamlit specific: proxy\_set\_header Upgrade $http\_upgrade; proxy\_set\_header Conn…

Best,  
Randy

---

<div class="post-metadata">

**Author:** ![ninth](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/ninth/32/8487_2.png) [@ninth](https://discuss.streamlit.io/u/ninth)\
**Post date:** [June 3, 2021, 2:43am UTC](https://discuss.streamlit.io/t/run-streamlit-in-https-mode/2829/3 "2021-06-03T02:43:29Z")

</div>

Hi, I was wondering if you found a solution to running it as https. I’m facing the same issue and was hoping for a quick and easy answer

---

<div class="post-metadata">

**Author:** ![maarten-betman](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/maarten-betman/32/6858_2.png) [@maarten-betman](https://discuss.streamlit.io/u/maarten-betman)\
**Post date:** [June 3, 2021, 4:46am UTC](https://discuss.streamlit.io/t/run-streamlit-in-https-mode/2829/4 "2021-06-03T04:46:25Z")

</div>

Mayde it’s possible to overwrite the `streamlit.server.server.start_listing` [function](https://github.com/streamlit/streamlit/blob/267bf98d9a8f8d94cf6d3e9f0ea8866233d4836e/lib/streamlit/server/server.py#L144) and add ssl\_options as explained in this [SO](https://stackoverflow.com/questions/18307131/how-to-create-https-tornado-server) thread?

If you serve the streamlit app on your own server, perhaps it’s easier to use a reverse proxy like nginx or traefik. If you use a PaaS like digitalocean app platform https is usually provided for you.

---

<div class="post-metadata">

**Author:** ![ninth](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/ninth/32/8487_2.png) [@ninth](https://discuss.streamlit.io/u/ninth)\
**Post date:** [June 3, 2021, 12:42pm UTC](https://discuss.streamlit.io/t/run-streamlit-in-https-mode/2829/5 "2021-06-03T12:42:22Z")

</div>

yeah I’m currently just testing out some video streaming on my phone but the server is on my PC. I need a secure connection. Would using a reverse proxy give me https ?

also if I deploy the code would this solution still work?
