Error when running docker compose up -d on Hetzner

Hello folks,

while trying to run n8n on Hetzner Cloud (Docker CE), I stumbled upon an error:

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting “/n8n-docker-caddy/caddy_config/Caddyfile” to rootfs at “/etc/caddy/Caddyfile”: mount /n8n-docker-caddy/caddy_config/Caddyfile:/etc/caddy/Caddyfile (via /proc/self/fd/6), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

I’ve followed the Hetzner installation guide ( step by step.

    • Caddyfile
      Screenshot 2023-09-21 060544

I’d be happy about any helpful responses.

Thank you in advance!

Best regards,
Ole N. Mai

Hi @Ole_Mai, welcome to the community!

The not a directory error suggests something might be off with the file paths you have in use.

Can you confirm where exactly your Caddyfile lives? Is that perhaps somewhere other than /n8n-docker-caddy/caddy_config/Caddyfile, for example ~/n8n-docker-caddy/caddy_config/Caddyfile instead?

1 Like

Hi @MutedJam,

you are right indeed, the file lives under ~/n8n-docker-caddy/caddy_config/Caddyfile instead of /n8n-docker-caddy/caddy_config/Caddyfile.

1 Like

Cheers @Ole_Mai. Can you try updating your DATA_FOLDER environment variable accordingly? So it no longer points to /n8n-docker-caddy but to the actual location of your n8n-docker-caddy folder?

On a more general note, it appears you are setting this up as the root user. I realise the documentation does not address this, but it’s probably not what you want to do (this isn’t specific to n8n, but avoiding the root user for everyday jobs is generally the best approach). You might therefore want to take a consider setting up a non-root user, for example as described in this guide:

(DigitalOcean also provides this guide for a number of different operating systems, in case you’re not running Ubuntu 22.04).

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.