S3 as primary storage installation

Hi all,

I would like to setup my nextcloud server (on AWS t3) to use S3 as primary storage - I am not interested to have it as external storage.

i do manage to install nextcloud:
sudo snap install nextcloud
and run the initial setup (from the webpage) but as soon as I modify the config.php I do get errors like:

Your data directory is invalid Ensure there is a file called “.ocdata” in the root of the data directory.

Here the complete config.php for your reference:

 <?php
$CONFIG = array (
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/snap/nextcloud/current/htdocs/apps',
      'url' => '/apps',
      'writable' => false,
    ),
  ),
  'objectstore' => 
  array (
    'class' => '\\OC\\Files\\ObjectStore\\S3',
    'arguments' => 
    array (
      'bucket' => 'bucket name', 
      'autocreate' => true,
      'key' => 'key',
      'secret' => 'skey', # I did create an user role IAM with all the privilege
      'use_ssl' => true,
      'use_path_style' => true,
    ),
  ),
  'supportedDatabases' => 
  array (
    0 => 'mysql',
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/tmp/sockets/redis.sock',
    'port' => 0,
  ),
  'instanceid' => 'oc8yk3p9idj4',
  'passwordsalt' => 'U56dt76KjEzTqnqkP7F84Ob49+9kay',
  'secret' => 'Go5insEtAztC47WoZ22WAJ0BZzMgm5q5OF5PxEEnflvEMQ6e',
  'trusted_domains' => 
  array (
    0 => '3.137.48.123',
  ),
  'dbtype' => 'mysql',
  'version' => '18.0.4.2',
  'overwrite.cli.url' => 'http://3.137.48.123',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/sockets/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'WSsv95PGPPZWjSobE-iB',
  'installed' => true,
  'maintenance' => false,
);

Could someone help me ? What I am doing wrong ?

Have you tried to use the search function of this forum to find an answer on your question? I know that this question has already been asked and most likely been answered several times :wink:

Additional information about how S3 need to be set-up can be found in the Nextcloud administrator guide,