Skip to content

HTTPS & trusted certs

Butler can serve any site over HTTPS with a certificate your browser actually trusts — no red padlock, no “your connection is not private” warning. It does this with its own certificate authority (CA) that’s installed into your Mac’s keychain during setup.

Terminal window
butler secure my-app

That issues a certificate for my-app.test and flips the site to HTTPS. Reload the page and https://my-app.test loads cleanly. Omit the name to secure the site in the current directory:

Terminal window
cd ~/Sites/my-app
butler secure

You can also secure a site from the Sites section of the menu bar app.

Terminal window
butler unsecure my-app
Terminal window
butler secured

By default Butler secures sites individually — a site serves plain HTTP until you butler secure it. You can change that globally from the menu bar app’s Settings → HTTPS Mode:

ModeWhat it does
Manual (default)A site serves HTTP until you secure it explicitly.
AutomaticEvery site is secured with its own certificate — no per-site action.

For browsers to trust Butler’s certificates, Butler’s CA has to be trusted by your system. This happens automatically during butler system install, which is why it prompts for your password once.

If you ever need to install the trust manually — for example after clearing your keychain — run:

Terminal window
butler trust

On a CLI-only install this needs to run under sudo in a terminal so it can add the CA to the system keychain. If you use the app, it can handle the trust prompt for you through the standard macOS security dialog.

If you use Vite through laravel-vite-plugin, its automatic HTTPS detection (detectTls) works with Butler out of the box — npm run dev serves over https:// using the same certificate as your site, with no vite.config.js changes.

It works because Butler keeps a Valet-shaped home at:

~/Library/Application Support/Butler/Config/valet/
├── config.json # the active TLD (the plugin reads .tld from it)
├── Certificates/ # <hostname>.crt + .key — the certs `butler secure` issues
├── Sites/ # one symlink per linked site
└── CA/ # Butler's certificate authority

The plugin looks for a Valet install at ~/.config/valet, so Butler symlinks that path at its own home:

~/.config/valet → ~/Library/Application Support/Butler/Config/valet

butler system install creates the link, and Butler keeps it pointing at the right place (repairing its own link if it goes stale). The per-site certificates in Certificates/ are the real ones Butler issues — nothing is copied or duplicated, so a cert you create with butler secure is immediately what Vite serves.

If you’d rather use a certificate you already have (say, a wildcard cert), point a site at it in butler.yml instead of using Butler’s CA:

ssl:
cert: /abs/path/to/site.pem
key: /abs/path/to/site-key.pem

Butler’s certificates are issued with a limited lifetime. To renew:

Terminal window
butler renew # renew site certificates
butler renew --expiring 30d # only those expiring within 30 days
butler renew --ca # renew the CA itself

Renewing the CA re-issues the root; you may be prompted to re-trust it.