Skip to content

Setting Up HTTPS Locally with mkcert

This guide explains how to set up self-signed certificates using mkcert to enable HTTPS for:

  • app.localhost → Frontend
  • localhost → Homarr homepage
  • docs.localhost → Documentation

Ensure you have brew installed (for macOS users).


Terminal window
brew install mkcert nss # needed for cross-platform compatibility (e.g. Firefox)
mkcert -install

On Windows (PowerShell), restart the terminal after installing and accept the security prompt from mkcert -install:

Terminal window
winget install FiloSottile.mkcert
mkcert -install
Terminal window
mkcert -cert-file certs/cert.pem -key-file certs/key.pem app.localhost localhost docs.localhost dashboard.localhost pgadmin4.localhost redisinsight.localhost

This creates a certificate valid for every localhost subdomain Traefik routes: app.localhost, localhost, docs.localhost, dashboard.localhost, pgadmin4.localhost, and redisinsight.localhost.

🚀 Final Step: Restart Docker & Services

Section titled “🚀 Final Step: Restart Docker & Services”
Terminal window
make compose-down
make dev
  • Try opening in Incognito Mode or clearing cache.
  • Restart your browser after adding the trusted certificate.
  • Ensure Traefik is correctly configured in dynamic.yml to use the generated certs.
  • Run the following command to reinstall mkcert’s local CA:
Terminal window
mkcert -install

3. Verify that the certificate contains the expected domains:

Section titled “3. Verify that the certificate contains the expected domains:”
Terminal window
openssl x509 -in certs/cert.pem -text -noout | grep -A 2 "Subject Alternative Name"

should output:

Terminal window
X509v3 Subject Alternative Name:
DNS:app.localhost, DNS:localhost, DNS:docs.localhost, DNS:dashboard.localhost, DNS:pgadmin4.localhost, DNS:redisinsight.localhost

4. Firefox on Windows does not trust the certificate?

Section titled “4. Firefox on Windows does not trust the certificate?”

Open about:config and set security.enterprise_roots.enabled to true, so Firefox trusts the Windows certificate store.