Setting Up HTTPS on localhost in Nuxt 3

During development, apps are usually served via HTTP. However, Storyblok v2 requires your app to be served via HTTPS. Please follow the steps below to enable this in a Nuxt 3 project.

  • Install mkcert on your system The installation instructions for macOS, Windows and Linux can be found in the mkcert Github repository.

  • Create a valid certificate by running the following command in your project folder:

mkcert localhost
  • In the project’s package.json, change the nuxt dev command to the following:
nuxt dev --https --ssl-cert localhost.pem --ssl-key localhost-key.pem