DEV Community

Bilal Bentoumi
Bilal Bentoumi

Posted on

πŸš€ Showcasing hostly β€” a terminal tool for local domains with HTTPS (no config files, no pain)

If you’ve ever worked on multiple local services, you’ve probably done this dance:

  • edit /etc/hosts
  • run a reverse proxy (Caddy / Nginx)
  • generate HTTPS certs with mkcert
  • fix broken configs after reboot
  • repeat for every project

I got tired of that.

So I built hostly β€” a terminal-first tool that manages local development domains with HTTPS, reverse proxying, and persistence in one place.


🧠 What is hostly?

hostly is an interactive terminal app for managing local development domains on macOS and Linux.

It lets you map friendly domains like:

https://app.local
https://api.local
Enter fullscreen mode Exit fullscreen mode

to local ports like:

localhost:3000
localhost:8080
Enter fullscreen mode Exit fullscreen mode

with:

  • πŸ” Trusted HTTPS (green padlock)
  • πŸ” Reverse proxy via Caddy
  • 🧩 Automatic /etc/hosts management
  • πŸ”„ Persistent routing across reboots

βš™οΈ The problem it solves

A typical local setup looks like:

app.local β†’ /etc/hosts β†’ localhost β†’ proxy β†’ your app
Enter fullscreen mode Exit fullscreen mode

But in reality:

  • /etc/hosts is manual and error-prone
  • Caddy config resets unless carefully managed
  • HTTPS locally is annoying to maintain
  • restarting your machine breaks everything

So developers end up duct-taping tools together.


✨ What hostly does differently

Instead of managing 4 different systems manually, hostly introduces a single source of truth.


πŸ–₯️ One terminal UI

hostly
Enter fullscreen mode Exit fullscreen mode

A full-screen interactive interface:

  • Add/edit domains
  • Map ports
  • Choose HTTP / HTTPS
  • Manage certificates
  • Control daemon syncing

πŸ” HTTPS that just works

hostly uses Caddy’s internal CA to issue trusted certificates locally.

So instead of:

β€œNot Secure βš οΈβ€

You get:

https://app.local βœ”οΈ (trusted)


πŸ” Automatic reverse proxying

Each domain is pushed to Caddy via its admin API:

app.local β†’ 127.0.0.1:3000
api.local β†’ 127.0.0.1:8080
Enter fullscreen mode Exit fullscreen mode

No config files to touch manually.


🧩 Safe /etc/hosts management

hostly only modifies a managed block:

# Hostly Start
127.0.0.1 app.local
# Hostly End
Enter fullscreen mode Exit fullscreen mode

Everything else stays untouched.


πŸ”„ Boot persistence (daemon)

Caddy loses dynamic routes after restart.

So hostly includes a sync system:

hostly sync
Enter fullscreen mode Exit fullscreen mode

And optional boot daemon:

  • macOS β†’ launchd
  • Linux β†’ systemd user service

It restores everything automatically.


πŸ“¦ Installation

Requirements

  • Node.js β‰₯ 18
  • Caddy installed
  • macOS or Linux

Install

npm install -g hostly
Enter fullscreen mode Exit fullscreen mode

Install Caddy:

brew install caddy
Enter fullscreen mode Exit fullscreen mode

πŸš€ Usage

Start the app:

hostly
Enter fullscreen mode Exit fullscreen mode

Add a domain:

  • Host: app.local
  • Port: 3000
  • Scheme: https

Then open:

https://app.local
Enter fullscreen mode Exit fullscreen mode

Done.


🧩 How it works (simplified)

Browser
  ↓
/etc/hosts (resolves domain)
  ↓
Caddy (HTTPS + reverse proxy)
  ↓
Your app (localhost:3000)
Enter fullscreen mode Exit fullscreen mode

hostly is the glue that keeps everything in sync.


πŸ–₯️ Tech stack

  • Ink (React for CLI UI)
  • Zustand (state management)
  • Caddy (reverse proxy + HTTPS)
  • Node.js
  • systemd / launchd integration

πŸ’‘ Why I built it

I wanted a local dev environment where:

  • I don’t touch config files repeatedly
  • HTTPS works by default
  • domains feel real (app.local, not localhost:3000)
  • everything survives restarts

So I turned it into a CLI tool.


πŸ§ͺ Try it out

npm install -g hostly
hostly
Enter fullscreen mode Exit fullscreen mode

πŸ“Œ Links


πŸ™Œ Feedback welcome

This is still early, and I’m actively improving it.

Feedback is welcome around:

  • CLI UX
  • missing features
  • developer workflow improvements

Top comments (0)