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.3.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.3.0
File Size Uploaded
localghost-3.3.0.tar.gz 170.4 kB Details

Built distribution (wheel)

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

Total release size: 377.9 kB

Release files / localghost-3.3.0.tar.gz

Download URL localghost-3.3.0.tar.gz
Size 170.4 kB
Tags Source
SHA-256 checksum
How to use checksums
46f4401587d06a718b0c280169873f08f3e25d86ce5cf1471c1c766d45fe9d26
BLAKE2b-256 checksum
How to use checksums
680b34472555c3a6d6cf294212b347a5f4ff2dfb5f8285694f61a723e39bc8cf
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.3.0-py3-none-any.whl

Download URL localghost-3.3.0-py3-none-any.whl
Size 207.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92c9e4cead382ccaa768d9be5e784b117312d57e4763293ad2244234d76ac4b9
BLAKE2b-256 checksum
How to use checksums
34a75c41661d2568528bc82c746b832214f915e87b9e579bd5d2205fb57edda5
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

This release

3.3.0 This release

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.0

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