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

Just a single local hub routing all your development apps by hostname.

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

This is local-development infrastructure, not a production proxy. It runs the hub — a single, loopback-only Traefik container — as the localghost Compose project on the localghost Docker network.

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, 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.

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

Start or reconcile only the shared hub with:

uvx localghost hub up

Open http://traefik.localhost for its dashboard, inspect it with uvx localghost status, and remove it with uvx localghost hub down.

Run it in the background with --detach and manage it afterwards:

uvx localghost run --detach
uvx localghost sessions list
uvx localghost sessions logs SESSION_ID -f
uvx localghost sessions stop SESSION_ID

See Saving project setup for .localghost.toml, Compose overrides, custom commands, explicit type selection, and safe updates.

To make the same project and secondary-service hostnames available inside a Tailscale tailnet, see Tailnet hosting. It uses an opt-in tagged gateway and split DNS; the ordinary .localhost routes stay local.

Documentation

The localghost documentation covers application integration, saving setup, host-native servers, HTTPS, operations, troubleshooting, security, architecture, and development.

For a local documentation preview, install the development dependencies and run uv run zensical serve.

Metadata

Release files for localghost 3.0.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 3.0.0
File Size Uploaded
localghost-3.0.0.tar.gz 143.1 kB Details

Built distribution (wheel)

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

Total release size: 316.3 kB

Release files / localghost-3.0.0.tar.gz

Download URL localghost-3.0.0.tar.gz
Size 143.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1966a3ae12f821b616143183d57428df8ddf69cee42e0e38760ed602f3eae2de
BLAKE2b-256 checksum
How to use checksums
dc469352c74d5253007217e18b30f925366b4ed656d50c3a60b00645074f3af8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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-3.0.0-py3-none-any.whl

Download URL localghost-3.0.0-py3-none-any.whl
Size 173.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f4baae5069708bbb571b070664c6a155a8871cbe41150886bf76afbf099b06a
BLAKE2b-256 checksum
How to use checksums
223ac4a31c2e50ef59a220b993a084352dbeb7da376776d73043c18c18b10f57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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 history Release notifications | RSS feed

3.3.0

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.0

2 release files

This release

3.0.0 This release

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.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