This repo shows you how to deploy a Streamlit application via ngrok using a Colab server.
- We will connect the Colab server with Visual Studio Code and code in this environment via Remote Tunnels. 🔗
- Then, we will create a Ngrok to deploy the app and make it accessible for everyone. 🌐
- If you only want connect Colab server, don't deploy streamlit app, you just need go to this file
connect_vsc.ipynb
, click Open in Colab and follow the next steps.
- To deploy streamlit app, you have to download and upload the folder deploy_streamlit or clone this repository to your Google Drive.
- Navigate to the folder in your drive and open the file colab
connect_vsc.ipynb
. The content will look like this:
-
Run all cells in the notebook. A popup will appear on the top left. You need to allow access to your Drive folder.
-
After completing, you will see a link and a code to connect your device:
-
Select "Connect with Tunnel..." and choose "GitHub".
-
Select "Colab Connect" and wait for the connection.
-
Once connected, navigate to the folder
/content/drive/MyDrive/
to access your Drive files. -
Choose the folder you want to work on. In this case, select the
deploy_streamlit
folder to deploy the app. -
Start coding directly in your Drive folder. Changes will automatically save to the Drive. 💾
- Create an account at Ngrok.
-
Retrieve your Ngrok auth token from this page and copy it.
-
Open the file deploy.ipynb, locate the relevant section, and paste your token.
-
Run all cells. If prompted, select Jupyter Kernel.
-
After completion, you'll see a link to open your Streamlit app. Share this link with others.
Note: The initial setup might take a few minutes!
You can check the log output in the file nohup.out
.