Permission denied in ec2 port 80

Hello all,
Thanks for sharing this great app. I was able to deploy an app in ec2 and access it externally with port 8501. But when i set the server.port =80 I got permission denied.
I already opened port 80 in the security group in ec2.
Any idea?

You need sudo permission/root account for use the port 80.

thanks, so how to run streamlit with sudo

Hi @moh555m555

For security reasons, I would not recommend you run Streamlit with sudo. Rather, take a look at this tutorial on how to set up a webserver (namely Nginx) to route requests from port 80 to other ports running various applications.

In your case, you only need to route requests from the β€œ/” route to your Streamlit app, wherever that may reside (e.g. port 8501).

Most web servers commonly available on EC2 instance deployments can accomplish this. Here’s how to forward requests to 80 to another port (8080 in this example) using Apache2.

Thanks for your question – please keep us updated on your experience using Streamlit as a web app!

1 Like

Thanks. I got it working by redirecting default port 80 to 8051 in iptables.