Adding files to Nextcloud locally on Server

Hi,

I’m new to nextcloud and just installed nextcloud server on my raspberry pi. I have a general question of understanding.

My goal is to locally (on the Raspberry pi) add a file to nextcloud. What I tried is to copy a file to my data directory /var/www/nextcloud/data/ncp/files . First of all, I need sudo to do this and secondly, the file is not synced - I cannot see it in the web UI.

Any hints, explanations of why this is not working are highly appreciated! Thank you very much,
Pascal

Adjust/verify file is owned by www-data
Running nc-fix-permissions should do that for you, after which you need to run nc-scan for NC and its database to know about the new file.