Local External Storage not working?

I have just installed Nextcloud Server on a fresh Ubuntu 18.04 LTS system, following this guide by DigitalOcean. I found it a bit odd that it did not involve setting up mariadb/apache2 like all the other guides, but this was the only one that worked to the end with no error messages. I wish to set up a NAS which I can access from other devices anywhere. This system has an 8TB LVM comprised of 2x 4TB hard drives (and a separate small hdd for the OS).

I have managed to get the web interface working using this system’s local ip address (192.168.1.xxx), and added the plugin for External Storage.

I added External Storage type (Local) and path “/mnt/lvm/”.

I then tried to test if it’s working by creating a new .txt file, but I get Could not create file "123123.txt" error message, with no other information.

Going back to the External Storage app via Settings, it no longer allows addition of new External Storages, nor editing of current configurations. If I click the tick (Save) on the right of my entry, a red stop sign appears on the left. If I click the stop sign, it immediately turns into a green sign with a tick, but the external storage folder still cannot be used.

Does anyone know what is going wrong here? Did I configure local external storage correctly?

There are 2 places to create external storages:

  1. From the user panel: https://.../index.php/settings/user/externalstorages
  2. Global from administrator panel: https://.../index.php/settings/admin/externalstorages. Here you can also forbid to create external storages from the user panel. Only admin can create external storage linked to local folder.

Please check if you enable or disable creation of external shares for users in 2, in this case 1 will not work as you described (user will see storages set by admin, but will not be able to change them or added new).

Check if web user has rights to write to the directory. Try to set it to 777 and check if it works, this will give you a hint.

Thanks! I was looking for the admin/externalstorages page but really could not find it again, I thought it just disappeared and got replaced by the user/externalstorages after ‘enabling’ external storage!

I have went back to that page and added both my user account and the admin account in the “Available for” field. However, this did not solve the issue.

I have also chmod 777’ed the mount point for my HDDs which I am trying to use as external storage, and that does not work either. I can create files in the Ubuntu file system, but this is not reflected on Nextcloud.

  1. Could you please verify if this is the right way to point to a local storage folder?
    I have entered /mnt/lvm under the “Configuration” field since it says Location before I enter anything.

  2. I see this error message at the top:

"smbclient" is not installed. Mounting of "SMB / CIFS", "SMB / CIFS using OC login" is not possible. Please ask your system administrator to install it.

Is this relevant to the issues I’m having?

To do so, you need to ether check this folder via NC GUI to trigger immediately refresh, or run command (e.g. via OS cronjob) to do re scan of external storage’s:

sudo -u www-data php /var/www/nextcloud/occ files:scan --path="tschneemann/files/externalShareMountName"

Check this out:

I have set rights to 664 and added my NC user www-data to the group of local folder owner - in my case sambashare) by running following command (see explanation here):

sudo usermod -a -G sambashare www-data

You can check if user belongs to correct groups by running command groups <user>, in my case:

# groups www-data
www-data : www-data sambashare

I have /at the end e.g. /mnt/lvm/ not sure if it is really relevant. And in your case it could be as following:

Nope, if you mounting local folder, not samba :grinning: I have the same message on top.


  1. You can test if your NC user has access to your local folder. E.g. for user www-data it could be:
    sudo -u www-data ls -la /mnt/lvm/
    Check if you can see content of the folder and then just try to access 1 particular file:
    sudo -u www-data tail /mnt/lvm/someFile.txt
    if not - you have access rights issue.

  2. I have a few external shares and to not mount it in root for this particular user you can create folder e.g. Externals and by mounting just set it as per screenshot. Folder fill be mounted under Externals under SomeFolder.

@gas85, are you sure the user would be www-data on a snap install? I’m running into the exact same problem as @jolly_jaybird and have found nothing works…

Nope, for snap it is totally different.
All Apps are installed under you home in .snap, e.g. ~/.snap. Applications suppose to access regular user files, but I do not use it and could not say help you exactly.
Wiki says your snap files under $SNAP_DATA ( /var/snap/nextcloud/current/ by default)

Removable media

Also note that the interface providing the ability to access removable media is not automatically connected upon install, so if you’d like to use external storage (or otherwise use a device in /media for data), you need to give the snap permission to access removable media by connecting that interface:

$ sudo snap connect nextcloud:removable-media

That’s what I thought; thanks, @gas85. Trying to set the permissions as requested and adapting them for a snap install yields no results; even connecting removable-media does nothing.

Oh, well.

It seems as though there is a “push” for nextcloud to be installed via snap from now on, so I hope the official wiki will reflect more specific instructions for that method.

Thanks for the insight.