The current n8n docker installation runs with PUID and PGID of 1000.
By doing this n8n runs on the system with the user 1000 is assigned.
For example in my installation environment 1000 id is the user mysql.
So n8n runs as mysql user.
The problem is when you create a folder or a volume and map this to docker and wants the n8n to write, edit and delete files and folders inside this parent folder, you have to chown the permissions for the parent folder to that of mysql user in my example.
The best thing is to create a user in linux for the n8n installation and assign that ID to the docker via environent variables.
So in docker compose will look something like that:
Please consider adding that option so we stop using others users permissions to folders and files so that n8n can write and modify files and folders locally in host.
Example of similar problem here: