flask-cloudflared
Start a TryCloudflare Tunnel from your flask app.
What it is and what it does
flask-cloudflared wraps a Flask application with a decorator that automatically starts a Cloudflare TryCloudflare tunnel, making your local Flask app accessible via a public URL without manual tunnel setup. It depends on Flask, requests, and tqdm, and runs your app on port 5000 by default while starting a metrics page on a random port between 8100 and 9000. You can retrieve the tunnel URL programmatically and customize the port, metrics port, and tunnel domain through function arguments.
The package is designed for rapid prototyping, testing, and sharing—scenarios where you need a temporary public endpoint without infrastructure setup. It abstracts away the Cloudflare tunnel CLI, letting you manage tunneling directly from Python code. For persistent or custom domains, you can pass a tunnel ID or config path to use your own Cloudflare tunnel configuration.
Use it for:
- Quickly share a local Flask development server with teammates or external users without deploying to production.
- Test webhooks or third-party integrations that require a public URL pointing to your local machine.
- Demonstrate a Flask prototype or MVP to stakeholders without setting up hosting infrastructure.
- Debug issues in a live-like environment by exposing your local app to the internet temporarily.
- Set up automated testing or CI/CD workflows that need a public endpoint for callback validation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Starts a Cloudflare TryCloudflare tunnel for a Flask app, exposing it to the internet with a public URL without manual configuration.
Yes, if you need rapid, zero-configuration tunneling for Flask development and testing. The low install friction, permissive license, and straightforward decorator API make it a practical choice for prototyping and temporary sharing. The aging maintenance status and small community (43 stars) mean it is not a long-term production solution, but it is reliable for its intended use case of quick local-to-public exposure.
Install
flask-cloudflared on PyPI
pip
pip install flask-cloudflareduv
uv add flask-cloudflaredpoetry
poetry add flask-cloudflaredInstalling flask-cloudflared
Before you install
Low install friction with three lightweight runtime dependencies. Last commit was 2026-01-27 and the repository is active, though the project shows aging maintenance signals with infrequent updates.
License in practice
Licensed under Apache Software License (permissive), which allows commercial and private use with minimal restrictions.
Quickstart
pip install flask-cloudflared
from flask import Flask
from flask_cloudflared import run_with_cloudflared, get_cloudflared_url
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello World'
@run_with_cloudflared
def run():
app.run()
if __name__ == '__main__':
run()
print(get_cloudflared_url())
Requires Python 3.6 or later and a working Cloudflare TryCloudflare service connection.
Verify before relying
- Whether the package works reliably with Python versions beyond 3.6, given the classifier specifies only 3.6 support
- Current status of Cloudflare's TryCloudflare service and whether it remains stable for production-like use cases
Package facts
| License | not declared (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — Flask, requests, tqdm |
| Maintenance | aging — 199 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 98,133/month — #13,103 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: flask_cloudflared-0.0.15-py3-none-any.whl
Keywords: flask, cloudflared
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
pyngrokpyngrok wraps the ngrok reverse-proxy binary…
permissive · top 5,000 on PyPI
prime-tunnelExposes local services via secure tunnels on…
permissive · top 15,000 on PyPI
cloudflareProvides a Python client library for the…
permissive · top 5,000 on PyPI
Flask-HTTPAuthAdds HTTP Basic, Digest, and Token…
permissive · top 5,000 on PyPI
flask-corsFlask-CORS handles Cross-Origin Resource…
permissive · top 1,000 on PyPI
sshtunnelEstablishes SSH tunnels to forward local ports…
permissive · top 1,000 on PyPI
cloudscraperBypasses Cloudflare's anti-bot protection by…
permissive · top 5,000 on PyPI
pulumi-cloudflarePulumi provider for Cloudflare that lets you…
permissive · top 15,000 on PyPI
Flask-LimiterFlask-Limiter adds rate limiting to Flask…
permissive · top 1,000 on PyPI
ngrokExposes ngrok's secure gateway service to…
permissive · top 15,000 on PyPI