mkcert — Zero-Config Local HTTPS Development Certificates
mkcert is a simple tool that creates locally-trusted development certificates with zero configuration. No more browser security warnings in local development — just run mkcert and get valid HTTPS for localhost and any custom domain.
Instalación con revisión previa
Este activo requiere revisión. El prompt copiado pide dry-run, muestra escrituras y continúa solo tras confirmación.
npx -y tokrepo@latest install 404fae4b-372b-11f1-9bc6-00163e2b0d79 --target codexPrimero dry-run, confirma las escrituras y luego ejecuta este comando.
What it is
mkcert is a simple CLI tool that creates locally-trusted development certificates with zero configuration. It installs a local Certificate Authority in your system trust store, then generates certificates that browsers accept without warnings.
mkcert targets web developers who need HTTPS in local development for testing service workers, secure cookies, mixed content, or OAuth callbacks. It eliminates the pain of self-signed certificates and manual trust store management.
The project is actively maintained and suitable for both individual developers and teams looking to integrate it into their existing toolchain. Documentation and community support are available for onboarding.
How it saves time or tokens
Without mkcert, setting up local HTTPS involves generating a CA, creating certificates, adding the CA to multiple trust stores, and repeating this on each machine. mkcert does all of this with mkcert -install followed by mkcert localhost. No OpenSSL commands, no manual trust store edits, no browser restarts.
How to use
- Install mkcert via Homebrew (
brew install mkcert), Chocolatey, or download from GitHub releases. - Run
mkcert -installonce to create and install the local CA. - Run
mkcert localhost 127.0.0.1 ::1to generate certificate and key files. - Configure your dev server (Vite, webpack-dev-server, nginx) to use the generated
.pemfiles.
Example
# Install mkcert and set up the local CA
brew install mkcert
mkcert -install
# Generate certificates for local development
mkcert localhost 127.0.0.1 ::1 myapp.local
# Creates: localhost+3.pem and localhost+3-key.pem
# Use with Node.js
node -e "
const https = require('https');
const fs = require('fs');
https.createServer({
key: fs.readFileSync('localhost+3-key.pem'),
cert: fs.readFileSync('localhost+3.pem')
}, (req, res) => res.end('Hello HTTPS')).listen(443);
"
Related on TokRepo
- AI Tools for Coding — Development tools and local environment setup utilities.
- AI Tools for Security — Security tools including certificate management and TLS configuration.
Common pitfalls
- Sharing mkcert-generated certificates across machines. The CA is local to your machine. Certificates will not be trusted on other machines unless you export and install the CA there.
- Using mkcert certificates in production. They are signed by a local CA that public browsers do not trust. Use Let's Encrypt or a commercial CA for production.
- Forgetting to run
mkcert -installfirst. Without installing the local CA, generated certificates trigger the same browser warnings as self-signed certs. - Not reading the changelog before upgrading. Breaking changes between versions can cause unexpected failures in production. Pin your version and review release notes.
Preguntas frecuentes
Yes, for development. mkcert creates a local CA that only your machine trusts. The CA private key stays on your disk. Do not share the CA key file, as anyone with it could generate certificates your machine would trust.
Yes. mkcert supports macOS, Linux, and Windows. It handles trust store installation for each platform automatically, including Firefox's separate certificate store via NSS.
Yes. Mount the generated certificate files into your Docker container. For the container to trust the CA, you also need to mount the CA cert and run update-ca-certificates inside the container.
Self-signed certificates are not trusted by browsers and produce security warnings. mkcert installs a CA in your system trust store, so certificates it signs are trusted by all browsers on your machine without warnings.
Yes. Run `mkcert '*.myapp.local'` to generate a wildcard certificate. This is useful when your local development environment uses multiple subdomains.
Referencias (3)
- mkcert GitHub— Zero-config locally-trusted development certificates
- mkcert README— Automatic trust store installation for all platforms
- Mozilla Server Side TLS— TLS certificate best practices
Relacionados en TokRepo
Discusión
Activos relacionados
tsup — Bundle Your TypeScript Library with Zero Config
tsup is the zero-config TypeScript bundler built on esbuild. It emits ESM, CJS, IIFE, and DTS files from a single command — the fastest way to ship a polished TypeScript package without writing Rollup config.
Parcel — Zero Configuration Web Application Bundler
Parcel is a zero-configuration build tool for the web that automatically handles JavaScript, CSS, HTML, images, and more. It features blazing-fast builds using Rust and multicore processing, with no config files needed to get started.
zcf — Zero-Config Setup for Claude Code & Codex
Zero-config initializer for Claude Code and Codex: one `npx zcf i` sets up workflows, routing, and optional MCP pieces in minutes.
Frappe Charts — Simple Modern SVG Charts with Zero Dependencies
A GitHub-inspired, zero-dependency charting library that renders responsive SVG charts with a clean API, built by the Frappe team.