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

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?


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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'] = '';

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.