LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

mkcert

creates locally-trusted certificates

TLDR

Install local CA
$ mkcert -install
copy
Generate certificate
$ mkcert [localhost]
copy
Multiple domains
$ mkcert [localhost] [127.0.0.1] [::1]
copy
Wildcard certificate
$ mkcert [*.local.dev]
copy
Specify output names
$ mkcert -key-file [key.pem] -cert-file [cert.pem] [localhost]
copy
Generate a PKCS#12 bundle
$ mkcert -pkcs12 [example.test]
copy
Show CA root directory
$ mkcert -CAROOT
copy
Uninstall CA
$ mkcert -uninstall
copy

SYNOPSIS

mkcert [options] [domains]

DESCRIPTION

mkcert creates locally-trusted certificates. It simplifies HTTPS for development.The tool installs a local CA and generates trusted certificates. No browser warnings.

PARAMETERS

DOMAINS

Domain names for certificate.
-install
Install local CA.
-uninstall
Uninstall local CA.
-key-file FILE
Key output file.
-cert-file FILE
Certificate output file.
-p12-file FILE
PKCS#12 output file (used with -pkcs12).
-pkcs12
Produce a ".p12"/".pfx" file with certificate and key (for Java/legacy tools).
-client
Generate a certificate for client authentication.
-ecdsa
Use ECDSA keys instead of RSA.
-csr CSR
Generate a certificate based on the supplied CSR.
-CAROOT
Print the CA certificate and key storage location.
--help
Display help information.

CAVEATS

Development only. Keep root CA secure. Don't share CA key.

HISTORY

mkcert was created by Filippo Valsorda to simplify local HTTPS development with trusted certificates.

SEE ALSO

openssl(1), certbot(1)

Copied to clipboard
Kai