You don’t have permission to upload or create files here

You should fix the permissions so that the webserver-user can write to the data/ folder.

Thanks for Help. I change de permissions in the data folder and files to 777 via Filezilla, and don`t work.
I need to make changes in some other folders or files?


I have the exact same problem and I am ashamed to say it, but I’ve probably spent almost one hour trying to solve it. To no avail, of course! :weary:
I run Nextcloud 11.0 alpha (git) on Debian (Sid) with nginx 1.10.1 and PHP 7.0.10. The permissions are fine, so that’s not the issue.

I will subscribe to this topic in case somebody do know a working solution.

Best wishes,

I solved it. It turned out that my nginx configuration was faulty!
So, OP: make sure your nginx configuration is correct.


Can you elaborate on what configuration problem you had? I use Apache2 but have the same error message no clue where to start looking.

Are you using a folder for NTFS by any chance, If so please read my thread on how to solve that issue You don't have permissions to upload or create files here - local (external ntfs-3g storage)

If not using NTFS I would force nextcloud to rescan the files

Hi, no my installation is based on Ext4 on a HD connected via USB to my raspbery pi2. With the default data location /var/www/html/nextcloud/data/, it all works fine. Obviously my SD 8GB card will run out of space quickly. Configuring the data directory to /media/pi/HD1TB/nextcloud/data/ after a fresh install creates an error that it can’t write or create. I’ve recursively set my my folder rights using chmod to 755 (read/write for the owner, read for group and other). The owner is (chown) www-data, which is what Apache2 is using on a Debian distribution. Because I read twice in a post that the problem was found with the web-server config, I was wondering if I needed to look in that direction.

Have you tried to mount the drive e.g. mount /dev/sd? (your 1Tb drive) /media/whatever and load such as an external local storage in nextcloud.

Will check that tonight. Thanks.
The cloud storage needs to avoid the 8GB SD card (from which the raspi boots) so I expected to have to do this at first run of NextCloud. I will search for the option to set external local storage.

The best option is to restore the settings of the webserver to the default data folder.

Then attach the external drive to your usb


to find the usb driver reference e.g. /dev/usb?

Partition at will (remember 4 primary and unlimited extended)

Format with parted or fdisk or use the LVM tools to convert such into logical volumes.

Mount the partition/s with

mount /dev/usb? /media/data

Edit the /etc/fstab to mount the partition/s at boot.

NextCloud - enable the app external storage

NextCloud - in the admin settings, select the external storage and mount the drive as data and remember to put in your mount point.

As you changed the data folder, it is best to force nextcloud to rescan by doing this in Ubuntu

cd /var/www/nextcloud
sudo -u www-data php console.php files:scan --all

Generally I like to restart apache or reboot to see if everything holds.

Just a tip to take into consideration, unlike servers, SoCs don’t have adequate air pressure cooling to run 247 so consider to embark on power management and wakeonlan features if possible on your Pi. This will enable you to boot your Pi remotely, then sync with NextCloud and on idle time, the Pi will shutdown.

1 Like

Well, thank you for the extended help. I already had a drive mounted and I added the external storage app, pointing it at the new location etc. Went all smoothly. What is not clear is if the external storage has now taken over from the intial location which was /var/www/html/nextcloud/data. Obviously, I can check when I start uploading. The 1st time I went with the default location, the server crashed after it filled the local SD quickly, which isn’t all that unreasonable. I’m trying it out now.

Sorry to ask more questions: where does it store the synced data now? The folder under /var/www/html/nextcloud/data/ and /media/pi/HD1TB/nextcloud/data/ are both empty folders.

Check out what you have set in your config/config.php as data-folder. If it is a mounted device, you can check with df -h if it is mounted at all.

I admit, I don’t get this:
The config.php lists

datadirectory => /var/www/html/nextcloud/data
overwrite.cli.url =>

The external storage app inside the nextcloud admin pages points to

Folder name: local1TB
External storage: local
Authentication: none
Configuration: /media/pi/HD1TB/nextcloud/data

This path exists with r/w right for www-data.

My synchromised files appear in the folder : /var/www/html/nextcloud/data

If I sync more files, the SD card of my raspi2 will fill up and the server will crash (an experiment I have successfully tried before).

What I want is to tell nextcloud to use the external HD for data storage only. How do you do this?

Does www-data have all the required permissions, also in the parent folders?
sudo -u www-data ls -ls /media/pi/HD1TB/nextcloud/data

You might have a good point there. I am not 100% sure but I believe to set the access rights I used something like this:

cd /media/pi/HD1TB/nextcloud/
chmod -R 755 www-data data
chown -R www-data:www-data data

i.e. not the full path. I will try this tonight. Sorry, my Linux knowledge is still not comprehensive after years of using it.
Thank you for your help.

1 Like


My folder rights

drwxr-xr-x 3 root root 4096 Jan 22 22:35 media
drwxr-x—+ 4 root root 4096 Jan 25 22:50 pi
drwxr-xr-x 4 root root 4096 Jan 22 23:05 HD1TB
drwxrwxr-x 3 www-data www-data 4096 Jan 22 23:05 nextcloud
drwxrwxr-x 2 www-data www-data 4096 Jan 22 23:05 data

I don’t understand why www-date is not be able to write to nextcloud and the data folders. I use the same chmod and chown commands to set the folder rights for the nextcloud installation path on /var/www/html/.

I started again with a fresh install. The same error message when you finish the installation
Can’t create or write in the data directory :unamused:

1 Like

Now that I’ve run the command

sudo chmod -R 777 /media/

giving all rights to all, nextcloud starts writing on the


folder. So the only conclusion I can take is that the www-data user is not running the webserver on my Rp2.

Why 777 vs 755?

That would be my question as well. I do not understand why opening all the doors (777) was required to get Nextcloud to write to the essential external HD attached to my RPi. I am not a Linux guru.