NextCloud with an Amazon S3 bucket as primary storage

TL;DR

You need to reinstall from scratch, migrating to S3 (or any other object storage) after installation isn’t supported.

https://github.com/nextcloud/server/issues/5865#issuecomment-341698048

You also have to configure the S3 settings before installation and dedicate the entire bucket to NextCloud.

Full details

The instructions I used to get my installation working are below but they were cribbed from;

https://github.com/nextcloud/server/issues/5865#issuecomment-332827521

Basically once you’ve extracted the installation from the tar file, you must add the S3 configuration before running the installation script.

Create a file storage.config.php in the config folder, I used a file similar to the one below.

<?php

$CONFIG = [
  'objectstore_multibucket' => [
    'class' => 'OC\\Files\\ObjectStore\\S3',
    'arguments' => [
      'bucket' => 'abc',
      'key' => '<AWS S3 Key>',
      'secret' => '<AWS S3 Secret>',
      'use_ssl' => true,
      'region' => '<AWS region>'
      'use_path_style' => false,
    ],
  ],
];

Run the installation script in Nextcloud via the web or CLI based installer.

The instance will now use the object storage as primary storage if all the connection details are correct.