Object storage S3 as primary storage - issue


Nextcloud version _: 17.0.2
Operating system and version _: Ubuntu 18.04
Apache or nginx version
PHP version : 7.3
db: pgsql 11

Issue :

i want to use s3 type object storage as primary storage

i can connect from nextcloud to the bucket as external storage.

but when i configure as primary storage
nextcloud does not work anymore

here is the configuration i have included in the config file

'objectstore' => array(
        'class' => '\\OC\\Files\\ObjectStore\\S3',
        'arguments' => array(
                'bucket' => 'my-nextcloud-storage-bucket',
                'autocreate' => true,
                'key'    => 'ACCESS-KEY',
                'secret' => 'SECRET-KEY',
                'hostname' => 's3.fr-par.scw.cloud',
                'port' => 443,
                'use_ssl' => true,
                'region' => 'fr-par',

is there something wrong in  the configuration that prevent nextcloud to work properly ?
1 Like

You must configure S3 as primary storage before you create any user.
If your create any user before you change to S3 the user won’t have a home directory anymore more.

1 Like

thank you for the information.
actually there is only the admin user

i have used this tutorial : https://www.scaleway.com/en/docs/install-and-configure-nextcloud-object-storage/

so your admin user has no home directory now.

just create a new admin user with occ on the cli. and delete the old one.

1 Like

i have rewrite the config file again
it is working now.

i should have done something wrong the first time

thank you

Hi @xavierl! I’m sort of newbie with Nextcloud admin… been using other file storage providers for some time, but now’s the time for me to set up my own! I really don’t know how to setup the config… Could you please show me how your config.php is correctly setup?
I’d really appreciate it!!

@Reiner_Nippes could you help me with this issue?
Anyone else?

did you follow the manual?


and did you put the setup of object storage into the config.php before you first initialize nextcloud?

1 Like

No, thank you for sharing the link!! Could you please give me an example of an accurately setup config? I really just don’t know where in the config to enter the objectstore line.
(I would love if you’d share yours! ) You could share a link of it here and DM me with it or post it publicly! Thank you very much!!

i don’t use s3 as storage backend.

if you want to use s3 as backend - as far as i know - you have to start with an “empty” installation. there is no migration of any data for existing user.

you may have a look at the template from my playbook.

you simply replace the vaiables {{ }} (e.g. {{ objectstore_s3_key }}) with your values and put it in nextcloud/config/config.php after you untar nextcloud and before you first login into nextcloud.

or you run the playbook on a new installed ubuntu machine. with correct values in the inventory you’ll get a working config.

1 Like

Thank you very much. I really appreciate this!!!

Could this possibly work on the one click Nextcloud app from Vultr, or should I rather start with a LAMP stack and install that way? Thank you again!

if you mean that i could integrated s3 as primary storage in the vultr on click nextcloud. no. because vultr is using a kind af of script like my playbook. but i have nor access to it.

if you mean if i could think about a way to use the vultr one click nextcloud machine. yes. if you have shell access you insert the s3 storage php config into the existing config. after that you have to create a new admin user with the occ command. and delete the old one. might work. not tested.

1 Like

Thank you very much!! You have been extremely helpful.
I’ll have a shot at it today!

I’m using your playbook… Brilliantly designed. Thank you!!

HI! This may be a stupid question…
I just used your playbook… It’s really powerfully built, thanks for all the work.
I’m wondering how to login as root for the first time? Where do I find the password and username?
I’m trying to use OCC, but it returns
Could not open input file: /var/www/nextcloud/occ

Please give me advice!
Thank you!

which one? there are three (+ one new branch).

normally the last message of the playbook looks like:

ok: [localhost] => {
    "msg": [
        "Your Nextcloud at https://nextcloud.example.tld is ready.",
        "Login with user: admin and password: fTkLgvPYdmjfalP8XgMsEg7plnoPsTvp ",
        "Other secrets you'll find in the directory /opt/nextcloud/secrets "

the path /opt/nextcloud/secrets is definded in a variable in group_vars/all.yml named nextcloud_credentials_store or credential_store.


the name of the default user of nextcloud is defined in the inventory:

1 Like

I don’t know which one I was using! But I just opened a new server and ran the Docker one.

I could log in perfectly! Thank you.

However, I can’t see the normal admin settings! When I log in, I can’t see the settings tab like normal. What is the reason for this / how can I make the button appear?
Thank you!

could you make a screenshot?


Notice that there’s no avatar in the upper right corner like there normally is.

EDIT: I was wrong… There’s actually an avatar. However, it’s hidden! I had to hover the arrow over that spot. I’m sorry…

I can’t tell if my bucket was sucessfully integrated, how can I check it?
Here is another screenshot (from the settings I did eventually successfully access…) It looks like my s3 bucket is not connected. How do I check?

first you can login and you see the default files. so everything should be ok. if i remember well from my testing, if the s3 backend is not created you can’t login.

go to your s3 bucket and check if there are objects. go to /opt/nextcloud/data - if you didn’t change my default - and check if it’s empty. at least there should be not admin folder.

the avatar is also empty for me during first login. if you create a user or relogin you should get an avatar.

1 Like

Ok, thank you so much!! I think everything’s ok. I really appreciate your help! It is as you said.