Trying to set up SSL locally with n8n but not able to make it work

Hi ,
I am trying to host n8n as https with SSL certs locally by editing the package.json.
but it’s not working . it is still saying that the specified path is not found. the certs are in the same directory where package.json is. Can anyone help?

Hi Anjana,
where you are getting these cmd line args from? You can find our env vars for https and ssl here. If you want to run npm run start with https and self signed certificates you can do something like this:

cross-env N8N_PROTOCOL=https N8N_SSL_KEY=C:\Users\{{name}}\localhost.key  N8N_SSL_CERT=C:\Users\{{name}}\localhost.crt npm run start

In this example I am using cross-env to set environment variables. If you want to use it as well you need to install it once npm install cross-env -g.

1 Like

Hi @marcus ,
Thanks for the reply. Where can I use this, in package.json right?

Hi Anjana,
if you execute the command inside your n8n project folder it will run npm run start with these environment variables.

  • N8N_PROTOCOL=https
  • N8N_SSL_KEY=/path/to/your/server.key
  • N8N_SSL_CERT=/path/to/your/server.crt