I was previously using n8n via npm, but recently switched over to Docker. Previously, I had no issues importing my workflows/credentials via CLI, but that’s no longer working for me. I’m using the exact same files that I had successfully imported before.
I have a really simple docker-compose file (just using it for testing purposes right now):
However, when I refresh my n8n page, there aren’t any workflows or credentials present.
I’m not super familiar with docker, so I assume the way I’m importing in the container is wrong. What’s the correct method for importing when running n8n in a docker container?
I did run the CLI commands inside docker containers in the past, without much of a problem tbh. I’ve even tested the commands you have used just now and a previously exported workflow was imported fine for me. So I am a bit puzzled as to what might have gone wrong here.
This might sound stupid, but is there any chance you are looking at the wrong n8n instance in your browser (something like http://localhost:5678 instead of http://localhost:8003 which would be where your docker container listens)?
I double-checked that I only have one n8n instance running. I also just completely wiped my VPS and started from scratch, and I’m still running into the same issue. I have a bash script that I use to bootstrap n8n. It’s pretty much the same as what I wrote above, but here it is so you can see exactly what I’m doing.
The problem is that when you enter a shell in the container (or run a command like I am), it’s being done as root. Most of the n8n stuff in the container is owned by the user node. There’s some weird permission stuff going on I guess. If I run the import commands as node, my workflows and credentials show up in n8n.