mkcert -cert-file cert.pem -key-file key.pem localhost 127.0.0.1

Category: Web App Development

mkcert -cert-file cert.pem -key-file key.pem localhost 127.0.0.1

Issue a locally trusted cert for localhost

Creates a certificate valid for both localhost and the loopback IP, written to the named files. The names listed after the flags become the certificate's subject alternative names. Point your dev server at cert.pem and key.pem to serve trusted HTTPS.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.