Skip to main content

publichost

Make localhost public

Share your local web apps instantly with a public URL.

🔗 Visit publichost.dev


🚀 Installation

pip install publichost

🏁 Quick Start

Expose any web server in one line.

from publichost import Tunnel
tunnel = Tunnel(port=3000)  # Expose local port 3000

print(f"🔗 {tunnel.public_url}")  # Get your public link

Example Output:

🔗 https://x8k2p.publichost.dev

Your local app is now online and shareable.


🌍 Works with Any Python Web Framework

Flask

from flask import Flask
from publichost import Tunnel

app = Flask(__name__)
tunnel = Tunnel(port=5000)

@app.route("/")
def home():
    return "Hello, publichost!"

if __name__ == "__main__":
    print(f"🔗 {tunnel.public_url}")
    app.run(port=5000)

FastAPI

from fastapi import FastAPI
from publichost import Tunnel
import uvicorn

app = FastAPI()
tunnel = Tunnel(port=8000)

@app.get("/")
async def read_root():
    return {"message": "Hello, publichost!"}

if __name__ == "__main__":
    print(f"🔗 {tunnel.public_url}")
    uvicorn.run(app, host="127.0.0.1", port=8000)

Works with any Python web server, including Django, Quart, Starlette, and more.


🔧 Custom Subdomains

By default, publichost assigns a random subdomain like x8k2x.publichost.dev.
To set a custom subdomain, pass it as an argument:

tunnel = Tunnel(port=5000, subdomain="mycustomapp")

Your app will be available at https://mycustomapp.publichost.dev.

Subdomain Rules:

  • Must be 6-32 characters
  • Can contain letters, numbers, and hyphens
  • Cannot be a reserved system word (e.g., admin, www, api)

📚 How It Works

  1. Install publichost
  2. Add one line of code
  3. Get a public URL instantly

For more details, visit publichost.dev.

Release files for publichost 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for publichost 0.1.6
File Size Uploaded
publichost-0.1.6.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for publichost 0.1.6
File Interpreter ABI Platform
publichost-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 15.1 kB

Release files / publichost-0.1.6.tar.gz

Download URL publichost-0.1.6.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
832708c02381d3fa481135ec9ca51f1b7659b226b7ed4ed4b4f0601868f98b63
BLAKE2b-256 checksum
How to use checksums
dbc28287671b302c26da531d6b15dedb7c346012ee3bb5495667cf6e8944c075
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release files / publichost-0.1.6-py3-none-any.whl

Download URL publichost-0.1.6-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7cc0dfd88813051a477f33ce21f3d47b3eed924fa0d717d277df79dbde6587a
BLAKE2b-256 checksum
How to use checksums
c303934253710dce8d83e5fb6f3bef24ce23a1cc8df2826d3889664058414b00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page