You don't have permissions to upload or create files here - local (external ntfs-3g storage)


I have NextCloud running on a mint install of Ubuntu 16.04 LTS (server edition) and have an issue when setting up a local “external storage” as I get the following error when I access the folder

You don't have permissions to upload or create files here

The local storage that I am mounting with label data (/media/win) on nextcloud is:

sdb                              836.6G
└─sdb1               ntfs        836.6G /media/win data

drive permissions in fstab is as follows

UUID=537FEF451930795B /media/win ntfs rw,auto,users,exec,nls=utf8,umask=003,gid=46,uid=1000    0   0

Giving my HTTP server ownership and permission as per nextcloud documentation for Local

sudo -u www-data chown -R www-data:www-data /media/win
sudo -u www-data chmod -R 0750 /media/win

I get the following error

chown: changing ownership of '/media/win': Operation not permitted

What could the cause of this problem be?

you should use the gid and uid of www-data (probably 33, check /etc/paswd and /etc/group for the ids)

I have checked the uid and gid of www-data, being 33 and amended the fstab permissions as follows:

UUID=537FEF451930795B /media/win ntfs rw,auto,users,exec,nls=utf8,umask=003,gid=33,uid=33   0   0

rebooted the server and still I get the error

You don't have permissions to upload or create files here

Anything else that I can try please.

Managed to solve the problem past the recommendations made by tflidd and I am typing the solution here to probably serve others who may run into this problem.


UUID=537FEF451930795B /media/win ntfs rw,auto,users,exec,nls=utf8,umask=003,gid=33,uid=33   0   0


sudo reboot

Force NextCloud to rescan files

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

And your ntfs local external storage is back in business.


@IgorGanapolsky can you reproduce the error you are getting.

This is an example output of the force scan

Scanning files for 2 users
Starting scan for user 1 out of 2 (username)
| Folders | Files  | Elapsed time |
| 28585   | 107801 | 02:11:30     |

see u cant just go to the usb with the location in my case /media/pi/ where mount is pointed to or u cant mount in the cloud data folder so umount the storage and mount it to desktop like sudo mount /dev/sda /home/pi(in my case where pi is the username and specify the same in the cloud page).but the only drawback is that you edit any files on the external storage

Hi @fab I know this is an older post but could you explain what exactly your fix here is doing, and if it’s still valid for NextCloud 13?

@fab I see you used gid=33 and uid= 33, is this the default settings? I am not sure how to determine the uid and gid of the webUI user…

I have fstab working no problem, I can get around the mounted directory via ssh, but I can’t get the webui to use it correctly. Just shows a red square to the left of the line item.

no need to rebout: mount -a

id -u www-data
id -g www-data

mount the external storage on different path than /mnt or /media, if you mount the external drives to /home/external1 for example it will work, you can make the mount path permanent on /etc/fstab, confirm if www-data can read those files, with www-data group allowed to read or as owner.

This is what happened to me on a raspi4 with SD card TF extension cable… nexcloud was starting but anything being access denied with “Read-only file system” error all over the place.
Change to another TF extension cable… and worked!