"404 page not found" because of n8n folder attributes

Describe the problem/error/question

After Docker Compose install got “404 page not found” (not only me, other people too).

After talking to community I was advised (that took hours to find):
Give all the rights (777) to the n8n folder. Also I enabled the subfolders.

This worked. But it is so counterintuitive. Is it a bug? Is it an undocumented feature?

Information on your n8n setup

  • n8n version: 1.1.1
  • Operating system: Ubuntu 22

Hey @artildo,

You shouldn’t need to set 777 for the folder, It would be nice to have more information like when did you notice this was it after uprgading to v1 and did you check the migration guide?

I suspect the issue here is likely where we changed the user in the container to node rather than root which is covered here: n8n v1.0 migration guide | n8n Docs

If this isn’t the issue can you share how you have n8n installed and what the n8n log output is when it fails? I would imagine it is a permission issue if setting 777 resolves it so we just need to work out what is going on.

Hi, @Jon Tried to re-crecreate

So I made brand new Ubuntu install according to the guide. Not worked
Launched the migration command `docker run --rm -it --user root -v ~/.n8n:/home/node/.n8n --entrypoint chown n8nio/base:16 -R node:node /home/node/.n8n

Not worked

Changed n8n-folder rights to 704… 706… 707… still not working

Added Recursive option to 707. Finally worked.

So I don’t know how it works, but to get it finally working required 707 and recursivity to the n8n folder.

Hey @artildo,

If you follow the install guide on a clean install then run the command it will work I did 2 installs over the weekend for some friends and it got it working. I am not sure why it didn’t work on your set up though, Was you following the Digital Ocean guide or another one?

@Jon, tried the Docker compose guide (as usual, I made dozens of installs previously). Got the “Bad gateway” and 404 errors (they kinda appeared one after another).

With the containers up I ran the command from the migration guide: docker run --rm -it --user root -v ~/.n8n:/home/node/.n8n --entrypoint chown n8nio/base:16 -R node:node /home/node/.n8n

Nothing changed. I stopped the containers and applied the command again (I guess, i didn’t have to do that)/ Restarted the containers. Nothing.

Only root/n8n rights changing helped me to get started.

Hey @artildo,

That is very unusual although I didn’t go through that guide, did you use the non root approach?

@Jon No, I always skipped the 2np paragraph about non-root approach. And for 2 years it worked just fine.

I know for sure that the same problem had at least 2 other people, one of them finally came out with the solution.

Hey @artildo,

So the change will be with the change to the user that n8n runs as in the container, Generally as a rule you shouldn’t run anything as root on a server unless it is required. In this case if you follow the steps to not run as root it should work.

I will need to do some digging on the root user side.


Unfortunately didn’t understand what to do. For now use this fix with the /n8n folder? Will wait what you find. I’m launching a course and must avoid any errors on installation.

On my VPS I am a root user and log in as a root user, so I can’t understand how to be a non-root user.

Hey @artildo,

A root user is the main admin user, Typically you would create another user account and use that once you have access then restrict the SSH access for the root user. This is something that is outside of the n8n configuration though and would be part of your own security practices. I would say though it is important to know how to manage a server and user accounts before self hosting n8n as it is very easy to make something insecure an example of this would be using 777 permissions on a folder.


Thank you. I will try figure out how to solve this issues not providing extra permissions to the folder.

1 Like

@Jon, did I get you correctly?

To launch n8n v1+:

  1. I need to manually create a user, called “node”
  2. Launch the permissions command in the migration guide

and in Docker compose guide there’s no instructions how to create this user?

upd. So I

  1. Added a user useradd node
  2. Launched docker run --rm -it --user root -v ~/.n8n:/home/node/.n8n --entrypoint chown n8nio/base:16 -R node:node /home/node/.n8n
  3. Restarted the containers stop/up -d

Nothing. Bad gateway and 404

I’m completely puzzled

Hey @artildo,

No you don’t need to make a user called node that is in the container already and you may need to run the command if you see a permission error.

We don’t really document how to use the OS itself to create OS users as that is outside of the n8n application.

Hey @Jon,

tried two different providers. No way, doesn’t work like that.
May it happen that for you didn’t use the Docker compose way of installation, there’s some problem with it? Maybe something had to be updated in this manual for the 1. version?

I keep getting this

The command for the :node" user doesn’t help.

Hey @artildo,

I am confident that I used Docker Compose to get it working and this is the guide I went through: Digital Ocean | n8n Docs

There are some changes that need to be made to the v1 setup to include what I have mentioned above although it would be nice to change the image again so that it doesn’t matter as much although it may be easier to use docker volumes instead.

Can you share the exact compose file you used and I will give it a go with that as well.

@Jon I always copy-pasted this text from the guide:

version: "3"

    image: "traefik"
    restart: always
      - "--api=true"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.web.http.redirections.entryPoint.to=websecure"
      - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true"
      - "--certificatesresolvers.mytlschallenge.acme.email=${SSL_EMAIL}"
      - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json"
      - "80:80"
      - "443:443"
      - ${DATA_FOLDER}/letsencrypt:/letsencrypt
      - /var/run/docker.sock:/var/run/docker.sock:ro

    image: docker.n8n.io/n8nio/n8n
    restart: always
      - ""
      - traefik.enable=true
      - traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)
      - traefik.http.routers.n8n.tls=true
      - traefik.http.routers.n8n.entrypoints=web,websecure
      - traefik.http.routers.n8n.tls.certresolver=mytlschallenge
      - traefik.http.middlewares.n8n.headers.SSLRedirect=true
      - traefik.http.middlewares.n8n.headers.STSSeconds=315360000
      - traefik.http.middlewares.n8n.headers.browserXSSFilter=true
      - traefik.http.middlewares.n8n.headers.contentTypeNosniff=true
      - traefik.http.middlewares.n8n.headers.forceSTSHeader=true
      - traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME}
      - traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true
      - traefik.http.middlewares.n8n.headers.STSPreload=true
      - traefik.http.routers.n8n.middlewares=n8n@docker
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - ${DATA_FOLDER}/.n8n:/home/node/.n8n

I have a feeling that the new user just has no rights to get to n8n folder, and the new command doesn’t fix it. It creates an empty “.n8n” folder and that’s it. When I grant wide folder access, it’s enough to build the containers. Then the access maybe again restricted

I have just finished an install


To get this far I ran the commands below once docker was installed, This uses the compose file and the env file from this post: Docker Compose | n8n Docs

myuser@28943:~$ history
    1  clear
    2  cd ~
    3  nano docker-compose.yml
    4  nano .env
    5  sudo docker compose up
    6  sudo docker run --rm -it --user root -v ~/.n8n:/home/node/.n8n --entrypoint chown n8nio/base:16 -R node:node /home/node/.n8n
    7  sudo docker compose up
    8  history

It look < 10 minutes to go through the complete process which is not bad, I am now going to do the same thing but using the root user instead of a normal user.

Next update… Ran as root and the same process works.


History output for the root user after the myuser was deleted

root@28943:~# history
   17  cd /root
   18  nano docker-compose.yml
   19  nano .env
   20  docker compose up
   21  docker run --rm -it --user root -v ~/n8n/.n8n:/home/node/.n8n --entrypoint chown n8nio/base:16 -R node:node /home/node/.n8n
   22  docker compose up
   23  history

@artildo I am not sure which commands you are using or what is in your .env but other than needing the extra step everything looks to be ok to me.

Hey @Jon,

tried to do like you do.
docker compose up (without -d) throw to some endless process with errors. So I launched only with “-d”, and still didn’t work out. Continuing searches.