Streamlit EC2


I have deployed a streamlit app and hosted it on an ec2 instance. I would love to have the app to start every time I start the ec2 instance (instead of ssh and “streamlit run”)

Has anyone ever done that ? I tried to change the crontab on ubuntu but didn’t work

Thank you!

Hi @benjamilbz ,

I’m currently not at home where I can check it. But isn’t there an option when starting the EC2 to run some of your provided scripts?

Check out here:

Let me know if this was any helpful for you.

Best, Alex

cron could be one way, another could be to create a systemd process:

(I don’t have a Streamlit article off-hand, as this isn’t really a Streamlit thing)


Thanks! I tried user data and crontab but didn’t work. I’m trying to avoid having to ssh to start the app - i’ll look into system d
thank you!

Understood. I would check to ensure that your script is available from the account where you want it to run. Often, a well chosen chmod or chown statement can make everything work as desired.

Got it - i’m a newbie here - the only script i want to run is “streamlit run” so that the app starts when i start the ec2 instance. What i tried is adding “@reboot streamlit run” to the crontab. Would you suggest a different way ?
thank you!