Stop Wrestling with localhost:3000! Use localias Instead
You've been there. Staring at http://localhost:3000 in your browser, wondering why your secure cookies refuse to set. Wrestling with CORS errors that only appear in development. Explaining to your designer why the OAuth callback URL keeps failing. And don't get me started on the nightmare of testing your responsive layout on an actual phone — because good luck accessing localhost:8080 from your iPhone.
What if I told you there's a dead-simple tool that eliminates all of this pain? Not a hack. Not a workaround. A legitimate, production-grade solution that turns https://frontend.test into http://localhost:3000 — complete with real TLS certificates, zero browser warnings, and network-wide access from any device.
That tool is localias, and it's about to transform how you think about local development forever.
Built by Peter Downs and powered by the battle-tested Caddy server, localias is the secure local domain alias manager that developers have been begging for. No more port numbers in URLs. No more "it works on my machine" certificate errors. No more configuring browser proxies or editing system settings until your eyes bleed. Just clean, professional local domains that mirror your production environment — because your development setup deserves better than localhost.
Ready to see what you've been missing? Let's dive in.
What is localias?
Localias is a lightweight, single-binary tool that creates custom local domain aliases for your development servers. Written in Go and designed with developer ergonomics at its core, it bridges the gap between messy local development URLs and clean, production-like domain names.
Peter Downs created localias after years of tolerating localhost:8080 and discovering that existing solutions like hotel (unmaintained) and chalet (a maintained fork) simply didn't cut it. As he notes in the project's documentation, even his friend Justin was desperately searching for exactly this tool — a sentiment echoed by thousands of developers who've since adopted localias.
What makes localias genuinely trending right now is its ruthless focus on simplicity without sacrificing power. Unlike alternatives that require Node.js runtimes, browser proxy configuration, or complex system modifications, localias is a single static binary that "just works." It automatically manages your /etc/hosts file, provisions real TLS certificates through its Caddy integration, and even broadcasts .local domains across your network via mDNS.
The project has struck a nerve because it solves problems that every modern developer faces:
- Microservices architectures with a dozen running ports
- Frontend frameworks demanding HTTPS for features like service workers
- Mobile testing requiring network-accessible development servers
- Team environments where consistent URLs prevent "works on my machine" syndrome
With support for macOS, Linux, and even WSL2, localias has become the invisible infrastructure that serious development teams rely on daily.
Key Features That Make localias Irresistible
Let's break down why developers are abandoning their old workflows and switching to localias in droves:
Clean URLs Without Port Numbers
Transform http://localhost:3000 into https://frontend.test instantly. Your browser, your CLI tools, your API clients — everything speaks the same clean language. No more memorizing which service lives on which port.
Production-Grade TLS Out of the Box
Here's where localias gets seriously clever. It automatically generates a local root certificate authority, signs certificates for each of your aliases, and installs everything into your system trust store. The result? Zero browser warnings. Your https://api.test shows the same green lock as any production site. Set secure cookies, test OAuth flows, and validate HTTPS-only features without friction.
CORS Problem? Eliminated.
Because localias serves everything behind genuine HTTPS on standard ports (80/443), cross-origin issues that plague localhost development simply vanish. Your frontend at https://app.test and API at https://api.test communicate seamlessly — just like they will in production.
Universal Tool Compatibility
Unlike browser-proxy solutions, localias aliases work everywhere: curl, wget, your HTTP client library, Postman, your test suite. Since it modifies /etc/hosts directly, every tool on your system respects these domains.
mDNS for Mobile & Network Testing
Create aliases ending in .local and suddenly your phone, tablet, or coworker's laptop can access your development server. Testing responsive designs on real devices becomes effortless — no ngrok tunnels, no network configuration, no hassle.
Team-Shared Configuration
Drop a .localias.yaml in your git repository root, and your entire team inherits the same alias conventions. Onboarding new developers? They clone, run localias start, and immediately have https://api.test, https://app.test, and every other service alias ready to go.
Flexible Deployment Modes
Run it interactively with localias run for debugging, or daemonize with localias start for persistent background operation. Configuration changes? localias reload applies them without restart.
Real-World Use Cases Where localias Shines
1. Microservices Development Chaos
You're running five services: auth (3001), api (3002), payments (3003), notifications (3004), and a Next.js frontend (3000). Without localias, you're juggling bookmarks and Postman collections full of port numbers. With localias:
auth.test: 3001
api.test: 3002
payments.test: 3003
notifications.test: 3004
app.test: 3000
Your team shares this config. Everyone's environment is identical. Onboarding takes minutes, not hours.
2. OAuth and Authentication Flow Testing
OAuth providers demand HTTPS callbacks. Local development used to require complex ngrok setups or accepting insecure warnings. With localias, https://app.test/auth/callback is genuinely secure — your identity provider accepts it without complaint, and you test the exact flow your users experience.
3. Secure Cookie and Session Development
Modern browsers restrict Secure, HttpOnly, and SameSite cookies to HTTPS contexts. Testing these on localhost often means disabling protections or using workarounds. Localias gives you real HTTPS locally, so your session handling development matches production behavior precisely.
4. Mobile and Cross-Device Testing
Create frontend.local pointing to your dev server, and your iPhone on the same WiFi network accesses it directly. Test touch interactions, viewport behavior, and performance on actual hardware — not Chrome's device emulator. For teams building PWAs or responsive applications, this is transformative.
Step-by-Step Installation & Setup Guide
Getting localias running takes under five minutes. Choose your preferred installation method:
Homebrew (macOS/Linux — Recommended)
# Install from the official tap
brew install peterldowns/tap/localias
Go Install (Cross-Platform)
# Run without installing
go run github.com/peterldowns/localias/cmd/localias@latest --help
# Or install permanently
go install github.com/peterldowns/localias/cmd/localias@latest
Nix (Flakes)
# Run directly
nix run github:peterldowns/localias -- --help
# Install to profile
nix profile install --refresh github:peterldowns/localias
Manual Binary Download
Grab pre-built binaries from the latest release:
Linux Privilege Setup
On Linux, localias needs permission to bind ports 80/443. Grant capabilities without full sudo:
sudo setcap CAP_NET_BIND_SERVICE=+eip $(which localias)
Your First Alias
# Create an alias for a frontend dev server on port 3000
$ localias set frontend.test 3000
[added] frontend.test -> 3000
# Verify it exists
$ localias list
frontend.test -> 3000
# Start the proxy server (foreground mode for first run)
$ localias run
# ... prompts for sudo password to modify /etc/hosts and install certificates
# ... certificate generation logs appear
# Server is running — visit https://frontend.test in your browser!
Pro tip: After the first run, subsequent starts won't prompt for sudo unless your aliases change. Hit Ctrl-C to stop, then localias start to daemonize for persistent background operation.
REAL Code Examples from the Repository
Let's examine actual patterns from the localias codebase and documentation, with detailed explanations of what's happening under the hood.
Example 1: Configuration File Anatomy
The localias configuration is refreshingly simple — just a YAML mapping of domains to ports:
bareTLD: 9003 # Serves over both HTTPS and HTTP
implicitly_secure.test: 9002 # HTTPS + HTTP, .test TLD implies secure intent
https://explicit_secure.test: 9000 # Force HTTPS (still serves HTTP too)
http://explicit_insecure.test: 9001 # HTTP only — no TLS certificate generated
What's happening here: Localias parses this YAML and generates Caddy configuration accordingly. The https:// prefix explicitly requests TLS certificate generation, while http:// creates a plaintext-only binding. The bare bareTLD entry gets the default treatment — HTTPS preferred with HTTP fallback. This flexibility matters when you're testing mixed-content scenarios or working with legacy services that can't handle TLS termination.
Example 2: Daemon Lifecycle Management
# Start the proxy server as a background daemon
localias start
# Check if it's actually running
localias status
# After modifying aliases, apply changes without restart
localias reload
# Clean shutdown when you're done
localias stop
Critical behavior to understand: The daemon caches your configuration at startup. If you run localias set api.test 4000 after starting the daemon, the change doesn't take effect until localias reload. This design prevents accidental disruption of running services while allowing explicit, controlled updates. The reload command signals the daemon to re-read configuration, regenerate Caddy rules, and refresh certificates — all without dropping existing connections.
Example 3: Team Configuration Discovery
Localias implements intelligent config file resolution:
# Explicit path override (highest priority)
localias --configfile /path/to/custom.yaml run
# Or via environment variable
LOCALIAS_CONFIGFILE=/team/shared/localias.yaml localias run
# Per-project config (checked if no explicit path)
# ./.localias.yaml in current directory
# Git repository root config (auto-discovered)
# $repo_root/.localias.yaml — commit this for team sharing!
# Fallback to user config
# MacOS: ~/Library/Application\ Support/localias.yaml
# Linux/WSL: ~/.config/localias.yaml
The git discovery mechanism is brilliant: When you're anywhere inside a git repository, localias walks up to the root and checks for .localias.yaml. This means your team commits one configuration file, and every developer automatically uses consistent aliases regardless of which subdirectory they're working in. Run localias debug config to see which file is active, and localias debug config --print to verify its contents.
Example 4: Debugging Certificate Issues
# Print path to the localias root certificate
$ localias debug cert
/Users/pd/Library/Application Support/localias/caddy/pki/authorities/local/root.crt
# On WSL: convert to Windows path for manual installation
$ wslpath -w $(localias debug cert)
\\wsl$\Ubuntu-20.04\home\pd\.local\state\localias\caddy\pki\authorities\local\root.crt
# Force certificate reinstallation to system stores
localias debug cert --install
Why this matters: Caddy generates a unique local certificate authority per installation. The debug cert commands expose this CA's location so you can manually install it in edge cases — Firefox's independent store, Windows hosts browsing WSL services, or CI environments. The --install flag explicitly triggers reinstallation, useful when system trust stores get corrupted or after major OS updates.
Advanced Usage & Best Practices
Avoiding HSTS Pitfalls
Never alias production domains locally. If you create example.com -> localhost:3000 and the real example.com uses HSTS, your browser will reject the certificate mismatch with scary errors. Stick to .test, .example, .localhost, or .local TLDs — they're reserved and safe.
Firefox Configuration
Since Firefox maintains its own certificate store, add this to about:config:
security.enterprise_roots.enabled = true
This trusts your system store, including localias's root CA. Alternatively, manually import the certificate via Settings → Privacy & Security → Certificates.
WSL2 Windows Browser Access
Browsers in Windows can't see Linux trust stores. After starting localias in WSL, run:
localias debug cert --install
This installs the certificate to Windows' store, eliminating browser warnings when accessing https://*.test from Edge, Chrome, or Firefox on the Windows side.
CI/CD Integration
For GitHub Actions testing with real HTTPS URLs, leverage the community-maintained github-action-localias. It handles Ubuntu's NSS database quirks and certificate warming that can cause flaky tests.
Comparison with Alternatives
| Feature | localias | hotel | chalet | ngrok | Manual /etc/hosts |
|---|---|---|---|---|---|
| Single binary, zero dependencies | ✅ Yes | ❌ Needs Node.js | ❌ Needs Node.js | ❌ Cloud service | ✅ Yes |
| Works in all tools (not just browser) | ✅ Yes | ❌ Browser-only | ❌ Browser-only | ✅ Yes | ✅ Yes |
| Automatic TLS certificates | ✅ Yes | ❌ No | ❌ No | ✅ Yes (paid) | ❌ No |
| Multiple TLDs simultaneously | ✅ Yes | ❌ Single TLD | ❌ Single TLD | ✅ Yes | ✅ Yes |
| Team-shared configuration | ✅ Auto-git-discovery | ❌ No | ❌ No | ❌ Per-user | ❌ Manual |
| No cloud dependency / fully local | ✅ Yes | ✅ Yes | ✅ Yes | ❌ Cloud relay | ✅ Yes |
| mDNS network broadcasting | ✅ Built-in | ❌ No | ❌ No | ❌ No | ❌ No |
| Process management agnostic | ✅ Yes (you control servers) | ❌ Tries to manage processes | ❌ Tries to manage processes | N/A | N/A |
The verdict: Localias combines the best of all approaches — the simplicity of manual hosts editing, the power of ngrok's HTTPS handling, and team collaboration features that nothing else offers — without cloud dependencies, browser limitations, or runtime bloat.
FAQ: Your Burning Questions Answered
Does localias work on Apple Silicon Macs?
Absolutely. Pre-built darwin-arm64 binaries are available, and Homebrew handles architecture detection automatically.
Is localias secure? Does it phone home?
Localias performs zero telemetry. All certificate generation happens locally via Caddy. The only network activity is mDNS broadcasting for .local domains, which stays on your local network.
Why does it need sudo?
Three operations require elevation: editing /etc/hosts, installing certificates to system trust stores, and binding to privileged ports 80/443. Localias never reads your password — it delegates to sudo subshells transparently.
Can I use custom ports instead of 80/443?
No, and this is intentional. Standard ports enable seamless HTTPS without port numbers in URLs, matching production behavior. The setcap approach on Linux avoids full root privileges for port binding.
What happens if two team members commit conflicting .localias.yaml files?
The file is a simple map — last-write-wins within git's merge resolution. Teams typically establish conventions (e.g., service-name.test: port) to prevent conflicts.
Does it support wildcard domains?
Currently, localias generates explicit certificates per alias. Wildcard support would require DNS challenge validation, which conflicts with the fully-local, zero-configuration design philosophy.
How do I completely uninstall and remove certificates?
Stop localias, remove the binary, delete ~/.config/localias (Linux) or ~/Library/Application Support/localias (macOS), and remove the "localias" CA from your system certificate store.
Conclusion: Your localhost Days Are Numbered
Let's be honest — localhost:3000 was never a good developer experience. It was a compromise we accepted because the alternatives were worse. But that era is over.
Localias delivers something genuinely rare in developer tooling: powerful infrastructure that disappears into the background. You configure it once, share it with your team, and never think about ports, certificates, or CORS again. Your development environment finally mirrors production. Your mobile testing actually works. Your secure cookies behave correctly.
Peter Downs built the tool he wished existed, and thousands of developers are now benefiting from that vision. The project is actively maintained, thoughtfully designed, and solves real problems without creating new ones.
Ready to upgrade your local development? Head to github.com/peterldowns/localias — install it in under two minutes, create your first alias, and experience what development feels like when your infrastructure finally gets out of your way.
Your future self — the one who never has to explain localhost:8080 to a designer again — will thank you.