Saturday, September 6, 2025
HomeLanguagesHow to Run Python Flask App Online using Ngrok?

How to Run Python Flask App Online using Ngrok?

Python Flask is a popular web framework for developing web applications, APIs, etc. Running flask apps on the local machine is very simple, but when it comes to sharing the app link to other users, you need to setup the whole app on another laptop. This article provides an interesting way to setup your web app online. Then, you can send the link to your peers before deploying it. Generally while running flask apps from our local machine we need to use LOCAL-HOST, but services such as google colab provides VM(virtual machine) hence we do not access the local-host. We will use it in to a public URL using ngrok. The Python library flask-ngrok.

Installation – 

Run from your terminal – 

pip install flask-ngrok

Create a Flask App – 

Now create a simple Flask application app.py – 

Python3




from flask import Flask
from flask_ngrok import run_with_ngrok
  
app = Flask(__name__)
run_with_ngrok(app)
  
@app.route("/")
def hello():
    return "Hello Geeks!! from Google Colab"
  
if __name__ == "__main__":
  app.run()


Run the app – 

Run the app using – 

python run.py

After clicking on the secure URL provided by ngrok in terminal, you can access your application – 

Here You go!!

Now you can use this URL on Google-colab or anywhere to access your running app.

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32270 POSTS0 COMMENTS
Milvus
82 POSTS0 COMMENTS
Nango Kala
6639 POSTS0 COMMENTS
Nicole Veronica
11803 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11869 POSTS0 COMMENTS
Shaida Kate Naidoo
6752 POSTS0 COMMENTS
Ted Musemwa
7029 POSTS0 COMMENTS
Thapelo Manthata
6704 POSTS0 COMMENTS
Umr Jansen
6721 POSTS0 COMMENTS