rensothearin
rensothearin

Reputation: 768

How to kill Ngrok tunnel from Google Colab Notebook

I am running Streamlit app from Google Colab Notebook.

Due to some limitations of sending out the URL of Streamlit app to outside, I follow the tutorial of using Ngrok for sending URL via tunnel.

I know that with a single ngrok client session, I can't run more than one tunnel. But in my case, I want to rerun and reconnect my Streamlit app to ngrok again.

So in order to do so, I want to kill the running Ngrok tunnel first.

So please anyone, could you tell me how to kill ngrok from Colab Notebook?

Upvotes: 1

Views: 2806

Answers (2)

Pranay Reddy
Pranay Reddy

Reputation: 1

You need to find the processes on which ngrok tunnel is running and kill it.

command to find the processes ids

ps -eaf | grep {{port on which ngrok is running}}

This will result in a list of processes that has a text match with the port number. Identify the ngrok tunnel processes and kill those processes running the following command

sudo kill -9 {{process id}}

Upvotes: 0

rlallen nps
rlallen nps

Reputation: 31

It's likely you have an orphaned Colab. Go to Runtime -> Manage Sessions, and terminate all of them and then try again.

Upvotes: 1

Related Questions