Skip to main content
This guide shows you how to use ngrok with Flask development servers to share your local application with others. You can use either the ngrok agent or the Python SDK to expose your Flask app.

What you’ll need

Option 1. Use the ngrok agent

To share a local Flask development server with someone else, run:
ngrok http 5000
You may need to update your SERVER_NAME and APPLICATION_ROOT in your Flask app configuration to the values provided by ngrok. See the Flask docs for more information.
For users on the latest MacOS, there is an issue where the default port 5000 (and 7000) is used by Apple AirPlay Receiver. You can use a different port for your Flask app or disable the Apple AirPlay receiver by disabling it in System Settings > General > AirDrop & Handoff > AirPlay Receiver.

Option 2. Use the Python SDK

You can use the ngrok Python SDK to start an endpoint to the Flask dev server via python code, or using a ngrok ASGI runner with an ASGI Wrapper.

Further resources