Skip to main content

localghost

Localghost gives local servers friendly .localhost URLs instead of port numbers:

  • https://storefront.localhost
  • https://admin.storefront.localhost
  • https://blog.localhost

One loopback-only Traefik hub routes every development app by hostname, so nothing needs its own port.

          ▒█████████████▒
        ███▒           ▒███░
      ▓██░               ░███           ██                          ██
     ██▒                   ▒██          ██░                         ██░
    ▓█▒                     ░██         ██░ ░█████░  ▒█████  █████▓ ██░
   ░██    ███▓       ████    ▓█▒        ██░░██   ██░▒█▓     ██░ ░█▓ ██░
   ██░    ███▓       ▓███    ░██        ██░░██░  ██░▒██     ██▒ ░█▓ ██░
   ██░         █   █          ██        ██░ ░█████░  ░█████  █████▓ ██░
   ██░         ▒███▒          ██░
   ██                         ██░            ░▒▒                       ░
   ██                 ▓█████████▒            ░▒▒                      ▒▒
   ██              ▓██▒▒▒▒▒▒▒▒██▒    ░▒▒▒▒▒▒ ░▒▒▒▒▒▒░  ▒▒▒▒▒░ ░▒▒▒▒░ ▒▒▒▒▒
  ░██░          ░██▓▒▒▒▒▒▒▒▒▒▒▒██   ░▒▒   ▒▒ ░▒▒  ░▒░ ▒▒░  ░▒░ ░▒░    ▒▒
  ▒████▓     ▒███▒▒▒▒▒▒▒▒▒▒▒▒▒▒██   ░▒▒   ▒▒ ░▒▒  ░▒▒ ▒▒░  ░▒░    ░▒░ ▒▒░
  ██▒▒▒▒▓▓█▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██░    ▒▒▒▒▒▒ ░▒▒  ░▒▒  ░▒▒▒▒░ ░▒▒▒▒░  ░▒▒▒
 ░██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██  ░▒   ░▒▒
 ░██▒▒▒▒███████▓▒▒▒▒███████▒▒▒▒▒██    ░▒▒▒
  ▒█████▓     ▒█████▓     ▒██████

Quick start

You need Docker Engine or Docker Desktop, Docker Compose 5.x+, uv, and port 80 available. From an application directory, run:

uvx localghost run

Localghost detects Django, Vite, Astro, CakePHP, Laravel, plain PHP, static HTML, and Docker Compose projects, starts the shared hub when needed, and keeps the local URL visible while the application runs. Press Ctrl+C to stop the application, or Ctrl+Z to detach and leave it running.

An unconfigured Compose project asks you to save its routing setup first:

uvx localghost save --run

Save a custom command the same way:

uvx localghost save --port 8080 --run -- ./server --port 8080

Use save when you want to persist setup without starting anything:

uvx localghost save

Hub and background runs

The hub starts on demand, but you can manage it directly:

uvx localghost hub up      # start or reconcile the hub
uvx localghost status      # inspect hub state and routes
uvx localghost hub down    # remove it

Its dashboard is at http://traefik.localhost.

Add --detach to run to keep an application going in the background, then use sessions, sessions logs NAME -f, sessions attach NAME, restart NAME, and sessions stop NAME to manage it.

Already running the server yourself, from a debugger or another tool? Use localghost forward NAME PORT to give its port a hostname.

Documentation

Start at the documentation home, or jump straight in:

Preview the docs locally with uv run zensical serve after installing the development dependencies.

Metadata

Release files for localghost 4.7.0

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

Source distribution (sdist)

Source distribution for localghost 4.7.0
File Size Uploaded Provenance Actions
localghost-4.7.0.tar.gz 221.9 kB Without provenance Details for localghost-4.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 481.2 kB

Release files / localghost-4.7.0.tar.gz

Download URL localghost-4.7.0.tar.gz
Size 221.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9fed4da17bf13f7e4f97fe5086132d129863109f9bd7a0bf56739656a6c154f0
BLAKE2b-256 checksum
How to use checksums
0651dfe0b99cb03706eb6cfb197e64a4379b1549b544255579e0778bab72becd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / localghost-4.7.0-py3-none-any.whl

Download URL localghost-4.7.0-py3-none-any.whl
Size 259.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9110710420605d101f59126591ebceca12128d3f7dbb5ec47be62791d6b49d19
BLAKE2b-256 checksum
How to use checksums
963907f5064a10f6a18ece66ee2d140aeef74efbae14ec5a617dc91f23f36bf3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for localghost 4.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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