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

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.2.1
File Size Uploaded
localghost-3.2.1.tar.gz 163.1 kB Details

Built distribution (wheel)

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

Total release size: 359.9 kB

Release files / localghost-3.2.1.tar.gz

Download URL localghost-3.2.1.tar.gz
Size 163.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a92d8056b689f6148fbfe915991a6fbba7d5964a4439f82bb8c943cf33ebc325
BLAKE2b-256 checksum
How to use checksums
f4c7feab23aa09ce3b600fa28e1131e6524320cf64d2c44acffc8e0e0b8841a2
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.2.1-py3-none-any.whl

Download URL localghost-3.2.1-py3-none-any.whl
Size 196.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b6392c4e3dc271e08cf43f356490d9e0a7017886d27d6a4c86ab832b334525d
BLAKE2b-256 checksum
How to use checksums
b91a9a9e068db428e0e91fa8c45ceb0feb167051305a4926e33b257437b8febb
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

This release

3.2.1 This release

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