Local TLS Certs With mkcert

Generate browser-trusted certificates for local development hosts.

LinuxcertificatestlsencryptionLow risk
Run mkcert localhost 127.0.0.1 to create a certificate and key trusted by your machine.

01Command

Command
$ mkcert localhost 127.0.0.1

02What it does

mkcert creates and installs a local CA, then signs certificates for the names you pass, which browsers on that machine trust automatically. That removes the constant warning when developing HTTPS locally without weakening real certificate validation.

03Risk

RiskLow risk
Requirementssudo apt install mkcert
!Warning: The local CA is trusted system-wide; never share the generated CA key, and remove it if the machine is repurposed.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Debian package: mkcert
    Debian · vendor-doc · 2026-09-20
    Evidence: Debian packages mkcert, which issues locally trusted development certificates.
  • mkcert
    Official project · vendor-doc · 2026-09-20
    Evidence: Debian packages mkcert, which issues locally trusted development certificates.

Last verified: 2026-09-22 · Category: Security & Privacy