If you've ever worked on multiple local services simultaneously, you're probably familiar with the tedious ritual: edit /etc/hosts, fire up a reverse proxy like Caddy or Nginx, generate HTTPS certificates with mkcert, then watch everything fall apart after a reboot. Developer Bilal Bentoumi got tired of duct-taping these tools together for every project, so he built hostly โ an interactive terminal application that manages local development domains, trusted HTTPS, and persistent routing in one place.
What Is Hostly?
hostly is a CLI-first tool designed for macOS and Linux that lets developers map friendly domain names like https://app.local or https://api.local to local ports such as localhost:3000 or localhost:8080. The application provides a full-screen terminal interface where you can add, edit, and remove domains; configure port mappings; choose between HTTP and HTTPS schemes; manage certificates; and control daemon syncing. Instead of juggling four separate systems manually, hostly introduces a single source of truth that handles everything through one unified workflow.
How It Works Under the Hood
The tool leverages Caddy's internal certificate authority to issue trusted SSL certificates locally, eliminating those annoying "Not Secure" warnings when you hit app.local in your browser. When you add a domain through the terminal UI and specify HTTPS as the scheme, hostly automatically pushes that routing configuration to Caddy via its admin API โ no manual config file editing required. The application also safely manages /etc/hosts by only modifying a contained block marked with "# Hostly Start" and "# Hostly End" comments, leaving everything else in the file untouched. The request flow looks like this: browser โ /etc/hosts (domain resolution) โ Caddy (HTTPS + reverse proxy) โ your application on localhost.
Surviving Reboots With Daemon Sync
One of hostly's key features is its boot persistence system. Since Caddy's dynamic routes are lost after a restart, the tool includes both a sync command for restoring configurations and an optional daemon that runs as a systemd user service on Linux or a launchd agent on macOS. Running hostly sync restores all your domain-to-port mappings automatically, meaning you set up your local environment once and it survives restarts without any manual intervention. This addresses one of the biggest pain points developers face when trying to maintain realistic-feeling local development domains across sessions.
Getting Started
The installation process is straightforward for anyone with Node.js experience. You'll need Node.js version 18 or higher, Caddy installed on your system (installable via brew install caddy on macOS), and either macOS or Linux as your operating system. Run npm install -g hostly to install the tool globally, then fire it up with the simple hostly command. From there, the interactive interface guides you through adding a domain โ you'll specify the hostname (like app.local), the port number (like 3000), and choose HTTPS as your scheme. After that, https://app.local resolves directly to your local application with a trusted green padlock.
Tech Stack
The project uses Ink โ a library that brings React's component model to CLI applications โ for its interactive terminal UI, paired with Zustand for state management. Caddy handles the reverse proxy and HTTPS termination layer, while systemd integration on Linux and launchd support on macOS enable the boot persistence features. The entire stack is built on Node.js.
Key Takeaways
- hostly eliminates manual /etc/hosts editing by managing a safe, contained block automatically
- Trusted HTTPS works out of the box using Caddy's internal CA โ no mkcert required
- Domain-to-port routing gets pushed to Caddy via its admin API with zero config file manipulation
- Boot persistence via systemd or launchd ensures your local domains survive restarts
- Installation requires only Node.js โฅ 18, Caddy, and a single npm command
The Bottom Line
hostly looks like exactly the kind of developer experience improvement that seems obvious in hindsight โ why were we managing four different tools manually when one well-designed CLI could handle it all? Bentoumi's approach of using Caddy's native APIs rather than fighting with config files is smart, and the boot persistence feature alone makes this worth trying. It's early-stage software, but if you regularly work with multiple local services that need realistic domain names, hostly might be worth adding to your dev environment toolkit.