ENOENT - no such file or directory, open - SSL key

Describe the issue/error/question

I have installed n8n on my local docker environment on windows system, and I want to expose the same on a fully qualified domain and need https on it. To enable https I’ve created self signed certificate and a key.

What is the error message (if any)?

I see following error when I do docker run

Initializing n8n process

 ›   Error: There was an error: ENOENT: no such file or directory, open 

 ›   'C:\Users\Client\Documents\DockerEnv\server.key'

Please share the workflow

Following is how my environment file looks like

N8N_HOST=sub.domain.com
N8N_PORT=443
WEBHOOK_URL=https://sub.domain.com
N8N_PROTOCOL=https
VUE_APP_URL_BASE_API=https://sub.domain.in
N8N_SSL_CERT=C:\Users\Client\Documents\DockerEnv\server.crt
N8N_SSL_KEY=C:\Users\Client\Documents\DockerEnv\server.key

and I use following command for docker run

docker run --env-file C:\Users\Client\Documents\DockerEnv\n8n.txt --restart unless-stopped -dit --name n8n -p 443:443 -v C:\Users\Client\Documents\Docker-PV\n8n:/home/node/.n8n n8nio/n8n

Share the output returned by the last node

Initializing n8n process

 ›   Error: There was an error: ENOENT: no such file or directory, open 

 ›   'C:\Users\Client\Documents\DockerEnv\server.key'

Information on your n8n setup

  • n8n version: latest
  • Database you’re using (default: SQLite): SQLite
  • Running n8n with the execution process [own(default), main]: own
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker

Hey @Saurabh_Periwal,

Welcome to the community :tada:

That error would suggest the path is not correct and doesn’t exist within the docker container you are using. Looking at it you are using a Windows path but the container uses a Linux OS, If you map those files as volumes so add…

-v C:\Users\Client\Documents\DockerEnv:/home/node/dockerenv

You can then set your env variables to /home/node/dockerenv/server.crt and /home/node/dockerenv/server.key that shoudl then solve the problem. You could also copy the 2 files into C:\Users\Client\Documents\Docker-PV\n8n and use /home/node/.n8n/server.crt and /home/node/.n8n/server.key

1 Like