I have a streamlit app in droplet. It worked using the ip address. To run the app I would go to console and type “streamlit run myapp.py”.
How do I deploy it so that I don’t have to type “streamlit run myapp.py” on the console?
Thanks for the help.
Other questions for the next step.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Heya @ferdinandmosca,
You should be able to deploy this using PM2 so that you don’t have to constantly type in
streamlit run myapp.py
.Additionally, in order to setup a domain and run it on https, I’ll recommend using Nginx as a reverse proxy.
1. Set Up PM2 to Manage Your Streamlit App
PM2 is a process manager for Node.js applications, but it can also be used to manage other types of applications, including Python apps like Streamlit.
The
--name
flag is optional but helps identify the process.2. Configure Nginx as a Reverse Proxy
Nginx can be used to reverse proxy your Streamlit app, making it accessible via a standard web port (like 80 for HTTP).
Add the following inside the
server
block:3. Domain and HTTPS
Setup Domain:
server_name
directive.Enable HTTPS with Let’s Encrypt:
Final Steps
This setup should ensure your Streamlit app is running continuously without manual intervention, accessible through a domain name, and secured with HTTPS.