Tutorials / Zero-Config HTTPS for Local Development
“It works on my machine” stops being a joke when your app only works over HTTPS — which is every app using secure cookies, service workers or third-party OAuth. Self-signed certificates get you the padlock icon with a red strike-through and a wall of warnings, which breaks the flow of testing the real thing.
The fix is mkcert: it creates a local Certificate Authority (CA), trusts it in your operating system, and then issues certificates for any domains you like — instantly trusted by your browser, with no warnings. This is the exact mechanism JengaDev uses under the hood. Here is how to do it yourself.
Windows (Chocolatey):
choco install mkcert
Windows (Scoop):
scoop bucket add extras
scoop install mkcert
macOS (Homebrew):
brew install mkcert
Linux (Debian/Ubuntu):
sudo apt install libnss3-tools
wget https://github.com/FiloSottile/mkcert/releases/latest/download/mkcert-linux-amd64
sudo install -m 755 mkcert-linux-amd64 /usr/local/bin/mkcert
mkcert -install
This generates a private CA on your machine and adds it to your OS trust store. You will never see “Your connection is not private” for mkcert certificates again.
Certificates are per-machine and per-domain. From your project folder:
mkcert myapp.test "*.myapp.test" localhost 127.0.0.1 ::1
You now have myapp.test+2.pem and myapp.test+2-key.pem in the folder. Notice we included localhost and 127.0.0.1 — handy if the same project runs on multiple hostnames.
Using .test domains keeps things clean: .test is reserved for testing and never resolves on the real internet. Map it to your machine in the hosts file:
C:\Windows\System32\drivers\etc\hosts (as Administrator)/etc/hosts
127.0.0.1 myapp.test
::1 myapp.test
On Windows, open your editor as Administrator or the file will silently refuse to save. This is also where JengaDev earns its keep — it manages hosts entries safely so you never touch this file by hand.
Hand the certificate to whatever serves your app. Examples:
Nginx:
server {
listen 443 ssl;
server_name myapp.test;
ssl_certificate /path/to/myapp.test+2.pem;
ssl_certificate_key /path/to/myapp.test+2-key.pem;
}
Vite dev server:
server: {
https: {
key: fs.readFileSync("myapp.test+2-key.pem"),
cert: fs.readFileSync("myapp.test+2.pem"),
},
}
Caddy (the JengaDev way): point it at the folder — Caddy and mkcert integrate so certificates are issued and loaded automatically.
Each developer runs mkcert -install on their own machine and gets their own certs. The rootCA.pem is private to each machine — never commit your local CA or keys to the repository, and never share them.
.pem and .key patterns to .gitignore.npm run certs or a Makefile target) that generates certs for new team members.When local HTTPS is free and instant, you test the real thing from day one: secure cookies, geolocation, PWA service workers, OAuth redirects — no surprises at deployment. The five minutes it takes to set this up save hours of “works locally, broken in prod” debugging.
mkcert certificates are trusted only on machines where you ran mkcert -install. That is the point — do not use them to secure production. Production wants Let’s Encrypt (which KIFAA automates end-to-end, but that is another story).
Tell us what you are trying to run — we will tell you the honest way to run it. Free consultation, no obligation.
Talk to the team