Is it possible to mount DO Spaces as external storage in Nextcloud as I mount AWS S3 storage?

Posted October 11, 2017 18.9k views
Object Storage

I’m using $5 Droplet for my Nextcloud instance. It is possible to mount AWS S3 buckets in Nextcloud as an external storage. So is it possible to mount Spaces as S3?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
6 answers

Yes! Spaces was designed to be compatible with S3 in order to take advantage of existing integration just like this. In order to mount a Space for external storage, you first need to enable the External Storage Support plugin just as you would for S3.

Next, add a new mount from the External Storages menu in the Admin panel. In the Bucket field, add the name of your Space. In the Host field, enter In the Region field, use nyc3. You can fine the needed Access Key and Secret Key for your Spaces account on the Applications & API page of the DigitalOcean control panel. Finally, make sure to select Enable SSL. When successfully configured, a green dot should appear:

External storage

Additionally, you might want to enable sharing. This can be done the the Advanced Settings which can be accessed by click the “cog” icon on the right:

Enable sharing

  • Wow! Such a good reply! Thank you for you detailed guide!

  • Is it also possible to mount it as primary storage?

  • Where this says: In the Host field, enter I assume it means use the end point

    For example my endpoint is: so I enter that and ams3 in the region field

  • In the end this would not work. Nextcloud is inscrutable, especially when run as a snap on Ubuntu (never again, but now I am trapped) so it is hard to see what the error really is

    I followed as closely as I could.

    Used endpoint as hostname, the prefix as region (no clue as to what port should be)

    For access key I used Name from Spaces access keys and copied the key to secret key

    Enabled sharing and previews, left available for at the default (all users) and it looks like the folder name field is causing a error. It is the default of AmazonS3. Tried various strings in there but to no avail.

    If ##!!# Nextcloud/Ubuntu would let me examine sane error logs I may have my own answers....

    I have the error: "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 using samba?

    • I have just tried following the comment and everything worked absolutely fine, immediately. I am using nextcloud 20.0.4 from within docker on my ubuntu machine. I also saw that error smbclient is not installed but it was a general error, not related to adding the s3 storage. In fact, you don’t need any samba for s3, as s3 is based on simple HTTP. So it should have worked for you already, I bet you just haven’t noticed that.

      • Lucky you

        I have given up on Nextcloud

        I am looking for a decent caldav server - and not a PHP hack like Nextcloud

        After using Nextcloud extensively for a year I am totally fed up with it. It is slow and clunky (typical of a sprawling snarl of PHP) has way too many features, which are inscurtible, has a very sparse community.

        The snap packages (I have not tried the docker packages) are a nightmare.

        As far as I am concerned PHP and Snap are both dead ends. Never again will I run either on any server I have control of.

        I see the point of snap in the IoT space, forced upgrades have a purpose there. But I want control. I want logs.

        Finally: After thirty years computing I am flabbergasted that so much new software and implementations hide logging. The most crucial tool, the cheapest (should be - often is not) easiest (ditto - logs should be text files, not database records, duH!).

Great answer!
Thanks for share!

I cannot get this to work. I’ve followed the DO tutorial for installing Nextcloud on Ubuntu 16.04 and now this one…no matter what, I always get a big red square.

I’ve seen some posts about Spaces not being compatible with NextCloud 13 ( Wondering if anyone else has this working with the latest version of NC.

  • Worked great for me on NextCloud 15 using Ubuntu 18. Keep in mind your Host and Region might be different from what @asb posted above. Go to your Spaces and then Settings and scroll down to where you see “Endpoint”. Copy this for your Host. Use just the subdomain for your Region.

    For example if you choose a San Fran datacenter it might look like this:
    Region: sfo2

@asb Unfortunately, this solution is not working for me. I configured a space first (bucketname e.g. bucket1), but NextCloud is trying to PUT a bucket of that name for storage. The bucket name already exists, so the configuration fails. “Creation of bucket ‘bucket1’ failed. Error executing Create Bucket on 409 Conflict Bucket Already Exists.” From what I can tell, the S3 configuration in NextCloud is expecting to be able to create buckets, but when you use a space, the space itself is already a Bucket, so NextCloud is unable to create it. If you put a Space that doesn’t exist as the bucket name, it gives a 403 permission denied, because you can’t create buckets in spaces through the API, or at least not through how NextCloud is trying to do it.

For Folder Name I’ve tried “/” and “AmazonS3.” Bucket is 'bucket1’. Hostname is Port is left empty. Region is sfo2. Enable SSL is selected. Not sure what else to try. If that doesn’t work I probably can’t use Spaces for this, which I’d like to.

  • I was running into this same problem, but got it to work.

    This is my config:

    bucket: {YOURSPACESNAME}
    region: sfo2

    This seems to be working for me, hope it works for you!

  • OK, I know I’m resurrecting a dead thread here, but just in case someone else searches on this topic…

    I also could not get this to work via the normal nextcloud process. Couldn’t specify an existing DO Spaces bucket because NC insists on creating it and specifying a non-existent bucket failed with a “XAmzContentSHA256Mismatch” error.

    What I ended up doing was to create the external storage instance on AWS, then log out of nextcloud. Then, using phpMyAdmin or the mysql cli, opened the nextcloud database and modified the entries in the “oc_external_config” table to point to my existing DO bucket with the proper access key and secret.

    This worked for me (NC 19 on FreeBSD 12.1). Try at your own risk. No warranties express or implied. :-)

Is it possible to add only a folder in a space? I have my space set as primary storage but I’d like to have more granular control over who sees what folders. If I could add folders individually, I could set group access rights to each folder.

Unfortunately NextCloud’s group folders app only works at the root level so any folders I make in it don’t show up at all if i’m using a space for primary.

I love this setup so far, I just don’t want to have to pay for a new space just to give each person a private folder!

  • Answered my own question!

    You can’t use group folders, but you can use the file access control app. I was using it backwards. I thought I was whitelisting, but it’s a combo. So, for “family” you are blocking those who aren’t in the family group but are tagged with the “family” tag, which you can create in settings under workflow. “Private” is the tag you’re looking to make.

    Just remember to think it out a bit before you start making the rules and tagging your folders. Make sure your admin permissions are thought out otherwise you’ll lose access until you figure it out!

    Another note for spaces, it seems as if once I make a folder, I only get one chance to adjust the tags because the details blade disappears afterwards. Normally you can click the menu icon and hit details, but It doesn’t seem to show up in external drives, or at least for spaces.

    I hope this saves some folks some time! It took me longer than I care to admit to figure this one out.