I am using self-hosted instance if both n8n and Nextcloud installed in Docker Desktop on my Macbook pro.
I am trying to create Nextcloud credentials in n8n to be able to retrieve files, and I cannot get to make it work, I have tried everything:
→ Make sure you’re using /remote.php/webdav/ with the trailing slash
→ Don’t use /remote.php/dav/files — that endpoint won’t work for n8n
→ Use a Nextcloud app password, not your main account password
Nextcloud: Avatar → Personal settings → Security → App passwords
If it still fails, try watching the Nextcloud logs while hitting “Test” in n8n:
docker logs -f nextCloudContainerName
docker logs -f nextCloudContainerName
For me there were only two most common errors which i found, 401→Credential Issues & 400→Url/Path. I recommend reading the official N8N Docs For NextCloud Credentials & Auth, let me know if you still face the same issue
UPDATE: So after going through all possible remedies recommended here and both in n8n and Nextcloude knowledge base, the one that worked was - adding trusted domains for reaching Nextcloud:
# (Optional) Allow the container name itself (if you want to call it as "http://nextcloud")
docker exec -u www-data -it <NEXTCLOUD_CONTAINER> \ php occ config:system:set trusted_domains 2 --value=nextcloud
Glad to hear you got it working
Adding the trusted domains is definitely one of the fixes that solves a lot of WebDAV connection issues. Nice job tracking it down