How to use DigitalOcean Spaces
A full product guide to DigitalOcean's object storage, from concepts to creating a bucket, settings, CORS and access keys, with annotated screenshots and animated walkthroughs.
Introduction
Cloud computing is evolving in a fast-paced manner today, where storage and accessibility play a significant role, as it helps reduce the time and space complexities. Every application has its unique processes; thus, customization also plays a significant role in the enhancement of using the Cloud to deploy various applications. Regarding technology, an extensible cloud can be a game changer for developers or any business, as using different tech stacks is prevalent in today’s development scenarios. Whether you are using Ubuntu or a Mern stack, the cloud should be able to process all of it efficiently. Security is also crucial, but it is handled using various algorithms. SSH protocol is being used most widely.
Digital Ocean is a cloud computing platform that provides virtual machines (VMs) and other resources for software developers. It is a cloud-based Infrastructure-as-a-Service (IaaS) provider that offers various services, including virtual private servers (VPS), object storage, block storage, and more. Digital Ocean is designed to make it easy for developers to deploy and manage applications in the cloud.
The critical factor which decides the performance of cloud computing is storage and accessibility; the faster the access is, the more likely the application will be efficient.
What are Spaces in DigitalOcean?
Digital Ocean Spaces is an object storage service from Digital Ocean that provides a simple, cost-effective way to store and serve large amounts of data. It is designed to store and serve large amounts of unstructured data, such as audio, video, images, and other static files. It is built on the same technology as Digital Ocean's cloud storage service and provides a simple, cost-effective way to store and serve large amounts of data. Data is stored in Digital Ocean Spaces using the Objects storage model. Data is stored in buckets, which are containers for objects. Objects are stored in buckets and can be accessed via a unique URL. Objects can be organized into folders and subfolders within a bucket. Digital Ocean Spaces also provides a web-based file manager for managing objects. Various models of storage are used in the cloud. Still, the Object Storage model is considered efficient in terms of storage and accessibility as it uses key-value pairs to store unstructured data, and hence, the indexing power increases.
Below is a diagram that can give a brief overview of what an object-based storage model is:

What are the benefits of using DigitalOcean Spaces?
DigitalOcean Spaces are compatible with new technologies, which include:
- Amazon S3 API: Spaces is compatible with the Amazon S3 API, which means that existing S3-compatible tools, libraries, and applications can easily be used with Spaces.
- Content Delivery Networks (CDNs): Spaces can be used with CDNs to improve the delivery of large media files and other unstructured data. Popular CDNs that work with Spaces include Cloudflare, Fastly, and Akamai.
- Backup and Recovery Solutions: DigitalOcean Spaces can be a backup and recovery solution for data stored on servers or other cloud services.
- Web and Mobile Applications: Spaces can store and serve static assets such as images, videos, and other files for web and mobile applications. Spaces can also store and serve dynamic content, such as user-generated content and user data.
- DevOps Tools: Spaces can be used with DevOps tools such as Docker, and Kubernetes to store and deploy code and configuration files.
Cost-Effective: DigitalOcean Space is a cost-effective solution for storing and serving large amounts of data. It is often cheaper than comparable services such as Amazon S3.
Easy to Use: DigitalOcean Spaces is easy to use and set up. It has a simple web-based interface that allows you to create and manage your Spaces quickly.
High Availability: DigitalOcean Spaces is designed to be highly available and reliable. It is built on the same infrastructure that powers DigitalOcean’s cloud hosting services.
Security: DigitalOcean Spaces provides secure storage for your data. It uses encryption to protect your data from unauthorized access.
Scalability: DigitalOcean Spaces is highly scalable. You can easily add more storage space as your needs grow.
How to set up and use DigitalOcean Spaces
To set up a DigitalOcean space, you can follow the below steps:
Create a DigitalOcean account
The first step is to sign up for a DigitalOcean account if you don’t have one yet. This will give you access to the Spaces service and other DigitalOcean products.

You can use the following buttons to sign up or log in if you have an account already.
Create a Space
Once you have signed in to your DigitalOcean account, navigate to the Spaces section of the dashboard and create a new space. You can choose your space’s name, region, and other settings.

- This displays all the available functionalities in the DigitalOcean instance.
- Here, you can click to access the Spaces page, which shows documentation related to the product, the API documentation, and also tutorials.
- You can click on Create Space Bucket, which will open up a new page where you can configure your Space.
Create Space Bucket
Once you click on Create Space Bucket, the following page appears.

- Choose your data center region according to your location from the list of available data centers.
- You can choose to enable CDN, as it enhances Content delivery.
- You can name your space here.
- Select the project to be included in the space you are creating.
- After confirming all the information, click on Create a Space Bucket, which will land you on the Spaces Bucket page.
An animated overview of the following process is presented below.
Use your Spaces bucket
Once you click on Create a Space Bucket, the following page appears.

- It showcases all the files that are currently uploaded to your bucket space.
- In settings, you can control accessibility, CDN enabling, and other functionalities related to your bucket space.
- Here, you can check your bucket origin URL or the CDN URL.
- You can use this button to copy the URLs.
- You can use the Upload button to upload your files and applications to your bucket space.
- You can also create a folder, in case you want to have any hierarchy between your uploaded application and files.
Settings
Once you click on Settings, the following page will appear.

- You can control the accessibility of your bucket here by clicking on Edit.
- You can either choose to disable CDN or remove all the historical data of your buckets from the cache of the DigitalOcean server by using the Change button.
- Here, you can configure the URLs and methods allowed to access your bucket.
- You can use this button to delete your bucket space.
File Listing
Once you click on the edit button, the following window appears.

- If you select Restrict File Listing, only requests signed with your Spaces access keys can list the files in your bucket.
- If you select Enable File Listing, anyone with the bucket URL can see the list of files.
CORS configuration (cross-origin resource sharing)
Once you click on Add, the following window appears.

- Here, you can enter the Origin URL, which will be allowed access to your bucket.
- You can authorize which methods you want this URL to use.
- You can define the headers that will be allowed to access your bucket.
- Here, you can define the cache verification of the received request to access your bucket.
An animated overview of the following process is presented below.
Please note, your Spaces bucket origin URL format is https://<bucket-name>.<region>.digitaloceanspaces.com
How to access Spaces outside DigitalOcean
To access Spaces, outside DigitalOcean, you must generate a Spaces key, which authenticates the user accessing your bucket space. You can control the access in Settings.
Generate an access key
To generate the access Key, scroll down to the API section in the feature listing pane of the DigitalOcean instance.

- API section lists all the access methods and keys that are currently being used with your bucket space.
- You can toggle to Spaces Keys and click on Generate New key.
After you click on Generate New Key, the following page will appear.

- Write down the name of your key here, and click on the tick mark to confirm.
- Click on Generate New Key, and the key-secret key pair will be generated.
- You can click on More to rename your key, and delete or regenerate it.
This key will be used to authenticate methods, and users accessing your bucket space.
Please note that Buckets cannot be transferred between accounts, so adding your team members before creating the buckets is recommended.
An animated overview of the following process is presented below.
Conclusion
To conclude, DigitalOcean Spaces uses an Object-based data storage model. Data storage in objects helps use less space in the cloud by allowing data to be stored more efficiently and organized way. Objects are stored hierarchically, allowing for more efficient data storage. This structure also allows for data to be accessed more quickly, reducing the time needed to access the data. Additionally, objects can be compressed, reducing the space needed to store the data. Finally, objects can be replicated across multiple servers, allowing for redundancy and improved reliability.
Want documentation like this for your product?