Cloud and security

Use HTTPS on localhost (mkcert)

A trusted certificate for localhost, so your local app runs on https:// with no browser warnings.

  1. Install mkcert (and Firefox support)
    Terminal
    brew install mkcert nss
  2. Create your own local certificate authority
    Terminal
    mkcert -install

    Asks for your password once to trust it.

  3. Make a certificate for localhost
    Terminal
    mkcert localhost 127.0.0.1 ::1

    Creates localhost+2.pem and localhost+2-key.pem in this folder. Point your dev server at those two files.

Undo it
  1. Remove the local certificate authority
    Terminal
    mkcert -uninstall && brew uninstall mkcert
  1. Install mkcert (and Firefox and Chrome support)Needs sudo
    Terminal · Ubuntu / Debian
    sudo apt install -y mkcert libnss3-tools
  2. Create your own local certificate authority
    Terminal · Ubuntu / Debian
    mkcert -install
  3. Make a certificate for localhost
    Terminal · Ubuntu / Debian
    mkcert localhost 127.0.0.1 ::1

    Creates localhost+2.pem and localhost+2-key.pem in this folder. Point your dev server at those two files.

Undo it
  1. Remove the local certificate authority
    Terminal · Ubuntu / Debian
    mkcert -uninstall && sudo apt remove -y mkcert
  1. Install mkcert
    PowerShell
    winget install FiloSottile.mkcert

    Close and reopen PowerShell afterwards.

  2. Create your own local certificate authority
    PowerShell
    mkcert -install

    Click Yes on the security warning to trust it.

  3. Make a certificate for localhost
    PowerShell
    mkcert localhost 127.0.0.1 ::1

    Creates localhost+2.pem and localhost+2-key.pem in this folder. Point your dev server at those two files.

Undo it
  1. Remove the local certificate authority
    PowerShell
    mkcert -uninstall; winget uninstall FiloSottile.mkcert

New to HTTPS? I explain it in plain English on Layman Terms.