Question

How to setup image upload on Strapi app setup as a Digital Ocean app

I plan on setting up a Strapi application as a DO app using this guide: https://www.youtube.com/watch?v=tnGqqUzzh6U

Please could anyone explain (or point me in the direction of a guide) that shows the process of how to use Digital Ocean to host images for my Strapi app, using the strapi upload plugin. In the video, they mention digital ocean spaces can be used to manage images but not sure how to actually connect the two.

Thanks!


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.

Bobby Iliev
Site Moderator
Site Moderator badge
April 14, 2023

Hi there,

What you could do is to use the strapi-provider-upload-do package here:

https://www.npmjs.com/package/strapi-provider-upload-do

This provider allows you to upload to the DigitalOcean Space using the AWS S3 API.

  1. You can start by installing the package with:
npm i strapi-provider-upload-do
  1. Create or update config in ./config/plugins.js with content
module.exports = ({env}) => ({
  // ...
  upload: {
    config: {
      provider: "strapi-provider-upload-do",
      providerOptions: {
        key: env('DO_SPACE_ACCESS_KEY'),
        secret: env('DO_SPACE_SECRET_KEY'),
        endpoint: env('DO_SPACE_ENDPOINT'),
        space: env('DO_SPACE_BUCKET'),
        directory: env('DO_SPACE_DIRECTORY'),
        cdn: env('DO_SPACE_CDN'),
      }
    },
  },
  // ...
})
  1. Create .env and add provide Digital Ocean config.
DO_SPACE_ACCESS_KEY=
DO_SPACE_SECRET_KEY=
DO_SPACE_ENDPOINT=
DO_SPACE_BUCKET=
DO_SPACE_DIRECTORY=
DO_SPACE_CDN=

In case that this helps, there has been a similar discussion on the Strapi forum as well:

https://forum.strapi.io/t/upload-media-to-digitalocean-spaces-using-strapi-v4/16135

Hope that this helps!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up