Report this

What is the reason for this report?

Setting up Drupal 8 s3fs module with DigitalOcean Spaces instead of s3

Posted on May 19, 2020

I’m attemtping to have digitalocean replace Amazon for file system storage with Drupal 8 using hte s3fs module.

Here is a tutorial for S3 setup with Drupal

Some settings that are required are:

# S3FS setting
$settings['s3fs.access_key'] = 'your access key';
$settings['s3fs.secret_key'] = 'your secret key';
$config['s3fs.settings']['bucket'] = 'yourbucketname';
$settings['s3fs.use_s3_for_public'] = TRUE;
# if you want to use S3 for private files, uncomment the line below:
#$settings['s3fs.use_s3_for_private'] = TRUE;

Does anyone have info on how to do this with DO instead?

Thanks!



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

What you have so far is correct. After this, you will need these two settings:

$config['s3fs.settings']['use_customhost'] = TRUE;
$config['s3fs.settings']['hostname'] = 'https://yourspaceregion.digitaloceanspaces.com';

These can also be set from the settings page(/admin/config/media/s3fs), and verified on the Actions tab (/admin/config/media/s3fs/actions). On the DigitalOcean side, make sure your domain is set to be allowed for GET/POST/PUT/DELETE so that you can perform all file operations.

Once set up, you will likely want to use the “Copy Local Files to S3” tool on /admin/config/media/s3fs/actions to copy your existing files to Spaces.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.