dmdm
O mneProjektyBlogKontakty
Napíšme siNapíšme si

dmdm

Softvérový inžinier & Vercel nadšenec. Tvorím rýchle, reaktívne webové zážitky.

Stránky

  • O mne
  • Projekty
  • Blog
  • Kontakty

Prepojenie

  • LinkedIn
  • GitHub
  • Twitter/X
  • Email

Viac

  • RSS kanál
  • Mapa stránok
© 2026 Dmytro Bobryshev. Všetky práva vyhradené.Naposledy aktualizoval Dmytro dňa 23. 6. 2026, 17:07
Späť na blog
DigitalOcean Intro Image

Complex to Simple: DigitalOcean Spaces

Dmytro Bobryshev13 dec 2025•2 min čítania

DigitalOcean Spaces is a simple, scalable cloud storage solution for managing files like media, backups, and logs outside your application. With S3 compatibility, stateless architecture support, and easy setup, it’s a practical choice for handling data efficiently while keeping your app lightweight and independent.

DigitalOceanAWS S3S3 CompatibilityObject storageLarge data servingData security

What is DigitalOcean (DO) Spaces ?

DigitalOcean Spaces - is a cloud storage service, where you can keep all your digital items in a “spaces bucket” — our special cloud-based folder.

UsageFeatures
Stateless architectureNo worries about disk space
BackupsIndependent storage
Archive logsExternal service that manages data storage
Media data (photos, videos, docs, etc.)Sharing access
Personal / Secret data (contracts, invoices, passports, etc.)Ability to have Stateless architecture

Differences between DO Spaces & AWS S3

DigitalOcean SpacesAWS S3
Very simple consoleFunctional console
Compatible with S3 APIExternal CDN supportACL policyCompatible with AWS services such as:Amazon CloudFront (for content delivery)Amazon Glacier (for long-term archival)AWS Lambda (for server-less computing)
Scalability: Petabyte-scaleScalability: Virtually unlimited
Video/image compressor/convertor
do-console

aws-s3-console

How to create DO Space ?

  1. Go to the DigitalOcean Console
  2. Choose the “Spaces Object Storage“ in the sidebar
do-sidebar

do-console
  1. Click to the “Create Spaces Bucket“ for create single space:
  2. Fill in the following fields in the image shown:
    For most cases on EU projects, Frankfurt will be the best option as it is supposed to be in the same data center as the VPS/Database
create-do-spaces
  1. Paste the shown DO variables to config and Forge environments.

Setup DigitalOcean CORS domains

if you see the same error, follow the steps below:

show-cors-errors-the-console

1. Select the Relevant Project and Space:In the sidebar, choose the project or DO spaces directly.Select the space or spaces (if we have more that one).

select-spaces
  1. Update CORS Configurations
add-new-settingconfiguring-cors
All "API" or "Monolith apps" domains could support all HTTP methods (GET, PUT, DELETE, POST, HEAD). The basic domain (like apps which only reached the content from API) could only allow the GET method for enhanced security, limiting interactions to data retrieval.

Example configuration:

cors.yaml
# API or Monolith apps domains:

Origin: https://example-api-domain.com
Allowed Methods: GET, PUT, DELETE, POST, HEAD
Allowed Headers: # No additional headers selected
Access Control Max Age: 0 # set this up by your requirements
cors.yaml
# Reached content domains:

Origin: https://example-domain.com
Allowed Methods: GET
Allowed Headers: # No additional headers selected
Access Control Max Age: 0 # set this up by your requirements 

Implement DO Spaces to Laravel Project

  1. Install the following package to your Laravel project:
  2. Update configs:
filesystems.php
-  'default_media_disk_name' => 'media',
+  'default_media_disk_name' => 'do_spaces',

Don’t forget add/update variables to “Environments“

filesystems.php
'do_spaces' => [
    'driver' => 's3',
    'key' => env('DO_SPACES_KEY'),
    'secret' => env('DO_SPACES_SECRET'),
    'endpoint' => env('DO_SPACES_ENDPOINT'),
    'region' => env('DO_SPACES_REGION'),
    'bucket' => env('DO_SPACES_BUCKET'),
],
Páčil sa Vám tento článok?

Začnime spolupracovať!

Máte na mysli projekt alebo sa chcete len pozdraviť? Som vždy otvorený novým nápadom a spoluprácam.

Kontaktujte maKontaktujte maZobraziť projektyZobraziť projekty
PredchádzajúciAdaptive Animated Underline Title with React and MotionĎalšíComplex to Simple: Redux and Flux architecture for beginners