Back to Top

Guide for Magento 2 Digital Ocean Storage

Updated 29 April 2024

Magento 2 Digital Ocean Storage Extension is a useful module that supports media files (like product images, media in the product description and short description, etc.) for all types of products and one can save Static files on the DigitalOcean server ie (HTML, CSS, JS).

Moreover, the extension enables the admin to upload media files of different product types from its local disk to the DigitalOcean server.

Therefore, will experience faster site loads or page loads due to unnecessary pause elimination and cater to heavy traffic.

Similarly, the admin can use an Amazon S3 server for digital media storage with the help of a Magento 2 Amazon S3 connector.

Features

  • Support all Adobe Commerce product types.
  • Also, all media files of all types of products (like product images, media in the product description, short description, editing images, etc) are stored and retrieved from the DigitalOcean Simple Storage Service (DigitalOcean) bucket.
  • It can save Static files on the DigitalOcean server ie (HTML, CSS, and JS).
  • Moreover, flexible settings to configure the module settings.
  • Further, set the server(Local/DigitalOcean) on which the file upload will happen.
  • Store and download the files from the DigitalOcean Server.
  • Check the bucket availability in just a click.
  • Customers can download the files from the DigitalOcean Server irrespective of time and place.
  • Additionally, the extension is fully open-source and easy to use.
  • All media files are stored and retrieved from the Digital Ocean Storage Service bucket.
  • Admin can check the bucket availability.
  • Admin can set cache time(max-age) for static content files.

Installation

The installation is quite simple just like the standard Magento 2 extensions.

Searching for an experienced
Magento 2 Company ?
Find out More

#1 Download Module

Firstly, you need to log in to the Webkul Store, go to My Account>My Purchased Products section, verify, and then download and extract the contents of this zip folder on the system.

#2 Upload Folder

Once the module zip is extracted, follow path src>app and then copy the app folder into the Adobe Commerce Cloud root directory on the server as shown below:

installation section

#3 Run Commands

You need to run the following commands:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex
php bin/magento cache:flush

Thus, in this way, you can install the module.

Multi-Lingual Configuration

Therefore, for Multilingual support, please navigate to Store>Configuration>General >Locale Options.  Also, select your desired language from the Locale option.

magento2-digitalocean-storage

Thus, in this way, a multi-lingual configuration can be done.

Language Translation

For module translation, navigate to the following path in your system  app/code/Webkul/DigitalOcean/i18n/en_US.csv. Open the file named en_US.CSV for editing as shown in the below screenshot.

translation step

Then replace the words after the comma(,) on the right in the file with your translated words.

translation

After editing and translating the CSV file, you need to save the translated file name according to your region language and country code such as – de_DE.CSV.

Followed by uploading the translated file to the same folder from where you have obtained it. Now your module translation is complete.

screenshot_from_2023_12_18_16_17_22-1

Thus, in this way, language translation can be done.

Note: If you’re looking to create a custom e-commerce website, it’s a great idea to hire Magento developers who can help you build a powerful and scalable online store.

Setting Up Credentials in DigitalOcean Server

Follow the steps mentioned below to create DigitalOcean Credentials-

www.digitalocean.com_webkul-store

If you have a DigitalOcean account then click on the Login button or to create an account click on the Sign up button.

cloud.digitalocean.com_registrations_newwebkul-store

The admin can use their Apple or Google account to sign up for the DigitalOcean or use their email ID to create the account.

cloud.digitalocean.com_registrations_newwebkul-store-1-1

To log in to the app click on the login button.

cloud.digitalocean.com_loginwebkul-store

Now you need to navigate space > space object storage and here you can create a new storage bucket. Click on the Create Space Bucket button to create a new space bucket.

Screenshot-2023-11-22T173039.028

You can also check the create bucket here. Here you can upload the files and create a folder to save the data. Also, you can view the saved data.

Now create the access key and secret key on the DigitalOcean server. Navigate to API > Applications & API > Space Keys.

Screenshot-2023-11-22T175052.116

Click on the Generate New Key button it will navigate you to another page.

Screenshot-2023-11-22T175208.688

Hence the key will be generated and you can use it on your Magento 2 store to configure the DigitalOcean storage.

Magneto 2 DigitalOcean Configuration

After the extension installation, the admin will configure the module settings by navigating to Stores > Configuration > Digital Ocean Storage as per the below image:

General Settings:

magento2-digitalocean-storage-configuration

Here, the admin under general settings will:

Allows files to save on Digital Ocean Storage – to save the file on the DigitalOcean server set this as YES else set it as NO.

Spaces Access Key ID – enter the Digital Ocean server access key which you will get after creating the account on Digital Ocean.

Spaces Secret Key – Fill the Digital Ocean server secret key which you will get after creating the account on Digital Ocean.

Bucket Name – Put the Digital Ocean bucket name that you have created in the Digital Ocean account.

Region – Enter the region of the bucket where you want the bucket to reside.

Data Center – Enter the data center name.

Check Bucket Availability – Click the “check” button to check the bucket availability. If it is available and exists in the Digital Ocean server, it shows the message “Available.

magento2-digitalocean-storage-configuration

Else, will show the error message as per the below image:

magento2-digitalocean-storage-configuration

If the bucket is not available on the Digital Ocean then we have to make of existing one.

Static View File Settings

Another section of the admin configuration is the Static View File Settings where the admin needs to configure fields such as Enable for Static View Files, Bucket Name, and Region as shown in the image below.

magento2-digitalocean-storage-configuration

The admin can configure the following fields under Static View Files Settings-

Enable for Static View Files- The admin can set this field as Yes or No.

Bucket Name- Now, the admin needs to add a name for the bucket.

Region- Further, the admin can select a region from the list.

Cache Settings

Furthermore, under the Cache settings, the admin will add the file extension, max-age, and action columns. After the max-age exceeds, the file will refresh on its own.

magento2-digitalocean-storage-configuration

Storage Configuration for Media in Cloud Commerce Digital Ocean

Firstly, the admin can run the command in the Adobe Commerce Cloud root directory. After enabling and adding credentials run the following command.

php bin/magento import:media:dos

Therefore, just after running this command, the Media Storage field will get set to the Digital Ocean automatically and all media will get synchronized with the Digital Ocean server.

Screenshot-2023-11-22T190724.067

Secondly, this can be done manually by moving to the Advanced > System menu option under the configuration setting. For setting up the Storage Configuration for Media.

magento2-digitalocean-storage-configuration

Under the Media Storage field, the admin will select the media storage location where all the website media will be stored.

After selecting the Digital Ocean from the list, the admin needs to click on the Synchronize button to synchronize all media with the Digital Ocean server and then “Save Config“.

Note:-  Media will not be available in the new location until the synchronization process is complete.

Setting Up Base URL in Adobe Commerce Digital Ocean for user media files

Initially, the admin needs to run the following command-

php bin/magento import:static-content:dos

Once the above-mentioned command is run, all the static files will be imported to the server.

The admin needs to now navigate to the web sub-menu option under the general setting option, to configure the Base URLs settings.

magento2-digitalocean-storage-configuration

Further, in the Base URL for User Media Files option, the admin will enter the Digital Ocean bucket URL that saves and retrieves the media files.

magento2-digitalocean-storage-configuration

The admin will also set base URLs in the secure mode as well.

If Static View files are enabled then add the static content bucket URL into the Base URL for Static View Files and run the following command.

Need this command to run after installation 

php bin/magento setup:static-content:deploy

2. Flush the cache and reindex all. Now the module is properly installed.

Uploading Downloadable Product

After the successful module configuration by the admin, the admin can now upload the media files concerning the products on Digital Ocean.

We can add the downloadable domain using the following command

php bin/magento downloadable:domains:add oceanbucket.nyc3.digitaloceanspaces.com

Above “oceanbucket.nyc3.digitaloceanspaces.com” For example, We have to use a URL as shown in the below screenshot.

Magento 2 Digital Ocean

For this, the admin will navigate to the Products -> Catalog -> Add Product as per the below image.

magento2-digitalocean-storage-downloadable-product

Select Downloadable Product from the Add Product drop-down list. This will navigate you to the New Product page.

magento2-digitalocean-storage-downloadable-product

The admin needs to enter the Digital Ocean downloadable product URL.

magento2-digitalocean-storage

Here, the admin will fill in all the required details of the downloadable product upload the downloadable file, and hit the Save button.

Magento 2 Digital Ocean

After saving the downloadable product, the file gets saved on the Digital Ocean Server and therefore, will get the Digital Ocean link.

Note: The admin will get the Digital Ocean link only after saving the product successfully.

The customer will download the product from the Digital Ocean Server just like any other product from the local Server.

However, the customer can download the product only after the admin has created the order invoice.

Media Files

Further, in this module, the data will be stored in the Digital Ocean server for all types of products. The data includes media files.

Media files are the images, videos, and GIFs associated with the products. Even, these images and videos are generally used to show the product details and give a better description of the same.

For example, the product’s main image, configurable images, demo product video, description image, GIFs, etc all fall under the category of media files.

magento2-digitalocean-storage-downloadable-product

So, whether it is any of the simple, virtual, configurable, grouped, bundled, or downloadable products, the media files will get stored in the Digital Ocean buckets.

magento2-digitalocean-storage-add-product

Further, when the customers will view the product they will get to see the product image will appear quickly. Also, the upload and retrieval rates are pretty quick for media files.

Frontend Product Page View

The users can check the products on the storefront and the source of the images.

Magento 2 Digital Ocean

Moreover, if the customer views the image in the new tab, the source includes Digital Ocean in the URL as shown in the image below.

Magento 2 Digital Ocean

CMS Page View

The images or media files are present anywhere in the store. Therefore take an example of the CMS pages.  This CMS page contains regular images, these will also be fetched from the Digital Ocean.

Magento 2 Digital Ocean

Furthermore, the same will happen with the images in CMS pages too.

Magento 2 Digital Ocean

Now, wrapping this up, this shows that all the images get retrieved from the Digital Ocean.

Thus, that’s all for the Adobe Commerce Digital Ocean Extension module. Furthermore, if you still have any issues, please contact us at Webkul Support System.

Also, if you want to upload your media and static files on Cloudflare R2 Storage then you can check out our Magento 2 Cloudflare R2 Storage.

Current Product Version - 5.0.0-p1

Supported Framework Version - Magento 2.0.x, 2.1.x, 2.2.x,2.3.x, 2.4.x

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home

Table of Content