Make your Flask app accessible online using Ngrok with Python #Shorts

Posted by


In this tutorial, I will show you how to make your Flask app available on the internet using Ngrok. Ngrok is a powerful tool that allows you to expose local servers to the internet by creating secure tunnels. This means that you can easily share your Flask app with others without having to deploy it to a live server.

Step 1: Install Ngrok
First, you need to download Ngrok from the official website or install it via the command line. You can find the installation instructions on the Ngrok website. Once Ngrok is installed, you can use it to create tunnels for your local servers.

Step 2: Run your Flask app
Before you can expose your Flask app to the internet, you need to run it on your local machine. Make sure you have Flask installed and your app is set up correctly. You can start your Flask app by running the following command in your terminal:

$ python app.py

This will start your Flask app on the local server.

Step 3: Expose your Flask app using Ngrok
Next, open a new terminal window and navigate to the folder where you installed Ngrok. Run the following command to create a tunnel for your Flask app:

$ ngrok http 5000

Replace 5000 with the port number on which your Flask app is running. Ngrok will generate a unique URL that you can use to access your app from anywhere in the world.

Step 4: Share your Ngrok URL
Once Ngrok has created a tunnel for your Flask app, it will display a forwarding URL in the terminal. This URL can be accessed by anyone who has the link. You can share this URL with your friends, colleagues, or clients to showcase your Flask app.

That’s it! You have successfully made your Flask app available on the internet using Ngrok. Now you can easily share your app with others without having to deploy it to a live server.

0 0 votes
Article Rating

Leave a Reply

12 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@supportme-o3n
3 hours ago

Great

@neverwantedjr
3 hours ago

Dude can you help me? How to make code like that but running on pterodactyl server?

@anishk.bansal4913
3 hours ago

Is this 24/7 for some apps on playstore

@Radon86lol
3 hours ago

i get code error number 13

@DjGregz81
3 hours ago

i've had a bad experience with ngrok. Ive opened a ngrok tunnel and got a ransomware. I guess this is not safe. I cant figure out how come they can intercept a tunnel or even the tunnel access.

@zainulabideen_1
3 hours ago

this is not working

@deanemarks8611
3 hours ago

This still work in 2023

@maheusbrito
3 hours ago

nao esta funcionando mais………

@015dayanidi3
3 hours ago

Bro I need this code .. this code is use full in my project bro

@skyline00069
3 hours ago

Guys, sadly this library (flask-ngrok) is down

@aaravsingh4860
3 hours ago

Brother do you have any project plz give me for my last sem

@tadsaitsaac7547
3 hours ago

If I do this then my computer becomes like a server? Can I write the url address of another computer and view the site?

12
0
Would love your thoughts, please comment.x
()
x