---
title: "Getting Started with DigitalOcean Spaces"
description: "Dive into DigitalOcean Spaces as an alternative to Amazon S3 and learn how to store files quickly and easily in this ATA Learning tutorial!"
canonical: "https://adamtheautomator.com/digitalocean-spaces/"
---

# Getting Started with DigitalOcean Spaces

> Dive into DigitalOcean Spaces as an alternative to Amazon S3 and learn how to store files quickly and easily in this ATA Learning tutorial!

Source: https://adamtheautomator.com/digitalocean-spaces/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Getting Started with DigitalOcean Spaces](https://adamtheautomator.com/wp-content/uploads/2023/06/digitalocean-spaces.jpg)

# Getting Started with DigitalOcean Spaces

[![](https://secure.gravatar.com/avatar/1bc5e1d52466fc3739f550c8d78be310684747bf1466a98d698320627ea243e2?s=192&d=mm&r=g)Michael Nguyen Tu](https://adamtheautomator.com/author/michael-nguyen-tu/)21 June 20239 min. read

Categories: [DevOps](/category/devops/)

Tags:[DigitalOcean](/tag/digitalocean/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Creating Buckets via the DigitalOcean Spaces Console](#creating-buckets-via-the-digitalocean-spaces-console)
*   [Uploading and Downloading Objects via the Spaces Console](#uploading-and-downloading-objects-via-the-spaces-console)
*   [Installing the S3cmd CLI](#installing-the-s3cmdcli)
*   [Retrieving Spaces Access and Secret Keys](#retrieving-spaces-access-and-secret-keys)
*   [Configuring the S3cmd CLI with the Access and Secret Keys](#configuring-the-s3cmd-cli-with-the-access-and-secret-keys)
*   [Creating Buckets via the S3cmd CLI](#creating-buckets-via-the-s3cmd-cli)
*   [Uploading and Downloading Objects via the S3cmd CLI](#uploading-and-downloading-objects-via-the-s3cmd-cli)
*   [Conclusion](#conclusion)

Are you looking for an affordable and reliable way to store, manage, and retrieve digital files? Well, say hello to DigitalOcean Spaces!

DigitalOcean Spaces lets you store your data at any scale. And in this tutorial, you will learn the basic knowledge of storing, managing, and retrieving files with DigitalOcean Spaces.

Discover how to maximize your file storage capabilities without overspending!

## Prerequisites

Before diving into DigitalOcean Spaces, make sure that you have the following:

*   A DigitalOcean account with active billing enabled – A [free trial](https://try.digitalocean.com/freetrialoffer/) is sufficient to get started.
*   A local machine – This tutorial uses an Ubuntu 20.04 machine.

Related:[How to Install Ubuntu 20.04 \[Step-by-Step\]](https://adamtheautomator.com/install-ubuntu/)

## Creating Buckets via the DigitalOcean Spaces Console

DigitalOcean provides an S3-compatible object storage service called Spaces Object Storage. This service lets you store and serve large volumes of data, such as images, videos, and static website files.

With the Spaces console, a user-friendly web-based UI, you can quickly navigate and manage your Spaces buckets. You can create buckets, upload files, set permissions, and organize your data with just a few clicks.

> 💡 _Designed to be compatible with the Amazon Simple Storage Service (S3) API, you can use existing AWS S3 Software Development Kits (SDKs) and tools to interact with DigitalOcean Spaces. This compatibility lets you quickly migrate applications or leverage existing code that integrates with AWS S3._

Related:[How To Upload Files to S3 with the AWS CLI](https://adamtheautomator.com/upload-file-to-s3/)

To create a Spaces bucket via the DigitalOcean Spaces Console:

1\. Open your favorite web browser, and log in to the [DigitalOcean Spaces Console](https://cloud.digitalocean.com/spaces).

2\. Once logged in, click **Create a Spaces Bucket** to initiate creating a new bucket. Your browser redirects to a page where you can configure your Spaces bucket (step two).

![Initiating creating a new Spaces bucket](https://adamtheautomator.com/wp-content/uploads/2023/06/image-179.png)

Initiating creating a new Spaces bucket

3\. Now, configure the following for your new Spaces bucket:

*   Choose a datacenter region – Select a region geographically close to your target audience. This option helps reduce latency and improve the overall performance of file transfers for your users.

> 💡 _DigitalOcean has multiple data center regions. These edge locations are geographically distributed and closer to the end users, allowing faster content delivery. At this point, no additional cost is associated with this feature._

*   **Content Delivery Network (CDN)** – Tick the **Enable CDN** box to enable a CDN for your Space. This feature is optional but highly recommended, as a CDN can speed up file transfers and reduce the amount of traffic on your origin server.
    
    When a user requests content from your Space bucket, the CDN caches and stores copies of that content on servers in multiple edge locations.
    

![Selecting data center region and enabling CDN](https://adamtheautomator.com/wp-content/uploads/2023/06/image-148.png)

Selecting data center region and enabling CDN

4\. Now, provide a bucket name and select a project as follows:

*   **Choose a unique Spaces Bucket name** – Provide a unique name (must be in lowercase) for your Space Bucket (**myfirstbucket458723**). Choose a concise but descriptive name to represent the purpose or content of the bucket.
*   **Select a project** – Choose the relevant project from the dropdown to track Spaces billing alongside other DigitalOcean services.

![Providing a bucket name and selecting the relevant project](https://adamtheautomator.com/wp-content/uploads/2023/06/image-149.png)

Providing a bucket name and selecting the relevant project

5\. Lastly, review the **Total monthly cost**, as shown below, and click **Create a Spaces Bucket** to finalize creating your new Spaces bucket.

![Finalizing creating the new Spaces bucket](https://adamtheautomator.com/wp-content/uploads/2023/06/image-150.png)

Finalizing creating the new Spaces bucket

## Uploading and Downloading Objects via the Spaces Console

You have just created your first Spaces bucket, but how do you know it works? Your bucket currently does not serve a purpose until you upload and download content to and from your bucket.

Luckily, DigitalOcean Spaces provides a quick way to upload or download objects from the console.

To upload an object to your Spaces bucket:

1\. Select your desired Space Bucket from the Spaces Console (**myfirstbucket458723**).

![Accessing the newly-created Spaces bucket](https://adamtheautomator.com/wp-content/uploads/2023/06/image-151.png)

Accessing the newly-created Spaces bucket

2\. Next, click **Upload** under the **Files** tab, and locate the files you wish to upload to your bucket.

![Locating files to upload](https://adamtheautomator.com/wp-content/uploads/2023/06/image-152.png)

Locating files to upload

3\. After selecting the files to upload, choose their permissions within DigitalOcean Spaces, and click **Upload** to upload the files to your bucket.

By default, the permissions are set to **Private**, letting you, as the owner, have sole access to the files. On the contrary, **Public** permissions allow everyone to view your file content online.

> 💡 _Note that you can always change the access permissions of an object at a later stage as per your requirement._

![Uploading the selected files with desired file permissions assigned](https://adamtheautomator.com/wp-content/uploads/2023/06/image-153.png)

Uploading the selected files with desired file permissions assigned

Depending on the object size, the upload process may take time. Once uploaded, you will see the files in your Space bucket, as shown below.

![Viewing the uploaded object](https://adamtheautomator.com/wp-content/uploads/2023/06/image-154.png)

Viewing the uploaded object

4\. Now, click the three-dot icon next to an object and select **Download**, as shown below, to download the file to your local machine.

Congratulations! You can now quickly upload and download objects to/from DigitalOcean Spaces.

![Downloading an object (file) from the Spaces bucket](https://adamtheautomator.com/wp-content/uploads/2023/06/image-155.png)

Downloading an object (file) from the Spaces bucket

## Installing the S3cmd CLI

The Spaces console works excellently if you only create one bucket as necessary. But what if you have to perform back operations on multiple objects or buckets? Worry not. DigitalOcean allows you to perform operations on your buckets via a command-line interface (CLI).

But before you can start creating Space Buckets via the CLI, you must install a compatible CLI utility — S3cmd CLI. This CLI utility is free, works cross-platform, and has built-in support for Spaces.

> 💡 _Unfortunately, at the time of this writing, the doctl CLI, the official DigitalOcean CLI, does not yet include Spaces support._

Related:[doctl DigitalOcean CLI : An Overview Guide](https://adamtheautomator.com/doctl/)

To install the S3cmd CLI on your system, follow these steps:

1\. Execute the following [`apt update`](https://linuxize.com/post/how-to-use-apt-command/#updating-package-index-apt-update) command to update your package index. This command ensures you are working with the latest versions of all packages.

```bash
sudo apt update -y
```

![Updating the system package index](https://adamtheautomator.com/wp-content/uploads/2023/06/image-156.png)

Updating the system package index

2\. Once updated, run the below `apt-get install` command to install the `s3cmd` utility.

```bash
sudo apt-get install s3cmd -y
```

Related:[Learning Ubuntu Apt Get Through Examples](https://adamtheautomator.com/ubuntu-apt-get/)

![Installing the S3cmd utility](https://adamtheautomator.com/wp-content/uploads/2023/06/image-157.png)

Installing the S3cmd utility

3\. Lastly, run the command below to check S3cmd’s installed version.

```bash
s3cmd --version
```

The output below confirms you have successfully installed the S3cmd CLI.

![Verifying the S3cmd CLI installation](https://adamtheautomator.com/wp-content/uploads/2023/06/image-158.png)

Verifying the S3cmd CLI installation

## Retrieving Spaces Access and Secret Keys

With the S3cmd CLI installed you need a way to authenticate and authorize access to your DigitalOcean Spaces resources. You must retrieve your Spaces access and secret keys.

These keys act as credentials to authenticate your requests when interacting with Spaces through the S3cmd CLI. In addition, these keys enable you to perform operations like creating buckets, downloading, uploading, and so on programmatically on your Spaces.

To retrieve your Spaces access and secret keys:

1\. Log in to your DigitalOcean console and navigate to the [Spaces API page](https://cloud.digitalocean.com/account/api/spaces).

2\. Next, click **Generate New Key** to generate a new access and secret key pair.

![Generating new access and secret key pair](https://adamtheautomator.com/wp-content/uploads/2023/06/image-159.png)

Generating new access and secret key pair

3\. Provide a name (i.e., **dospaceskey**) for the new access key, and click the check icon to save the key pair.

![Naming the new access key](https://adamtheautomator.com/wp-content/uploads/2023/06/image-160.png)

Naming the new access key

4\. Now, copy and save these keys in a secure location, as you will need them when you configure the S3cmd CLI later in this tutorial.

> 💡 _Never publicly share or expose these keys; they provide full access to your DigitalOcean Spaces resources._

![Copying and saving the new keys in a secure location](https://adamtheautomator.com/wp-content/uploads/2023/06/image-161.png)

Copying and saving the new keys in a secure location

## Configuring the S3cmd CLI with the Access and Secret Keys

Now that you have your Spaces access and secret keys, you can establish a secure and authenticated connection between the utility and your DigitalOcean Spaces. You must configure the S3cmd CLI using these credentials.

To configure the S3cmd CLI, follow the steps below:

1\. Run the `s3cmd` command to initiate the S3cmd configuration wizard (`--configure`).

```bash
s3cmd --configure
```

Provide the key pairs when prompted and other necessary details, as shown below.

![Providing the key pairs and other necessary details](https://adamtheautomator.com/wp-content/uploads/2023/06/image-162.png)

Providing the key pairs and other necessary details

2\. Next, provide the endpoint URL of your Spaces based on the [region](https://docs.digitalocean.com/products/spaces/details/availability/) where you want your buckets to be located. The DigitalOcean Spaces endpoint is a specific URL that identifies the location of your Spaces resources within a particular region.

Providing the correct endpoint lets you configure your S3cmd CLI or interact with your DigitalOcean Spaces programmatically.

For example, if your buckets are in the New York 3 (NYC3) region, the Spaces endpoint would be _**nyc3.digitaloceanspaces.com**_.

![Providing the Spaces endpoint URL](https://adamtheautomator.com/wp-content/uploads/2023/06/image-163.png)

Providing the Spaces endpoint URL

3\. Input **%(bucket)s.nyc3.digitaloceanspaces.com** for the hostname, but replace **nyc3** with your actual region.

The **%(bucket)s** placeholder represents the name of your specific bucket. This placeholder will be replaced with the actual bucket name when creating buckets.

![Configuring the hostname](https://adamtheautomator.com/wp-content/uploads/2023/06/image-164.png)

Configuring the hostname

4\. Now, leave the **Encryption password** and the **Path to GPG program** fields blank and press Enter to accept the default values.

There is no need to set an encryption password since this setting is solely for AWS S3. You will use the HTTPS protocol for DigitalOcean Spaces instead (step five).

![Accepting default values for the encryption password and path to the GPG program](https://adamtheautomator.com/wp-content/uploads/2023/06/image-165.png)

Accepting default values for the encryption password and path to the GPG program

5\. Type **Yes** and press Enter to enable the HTTPS protocol.

This encryption ensures that the information transferred remains confidential and secure.

![Enabling the HTTPS protocol](https://adamtheautomator.com/wp-content/uploads/2023/06/image-166.png)

Enabling the HTTPS protocol

6\. Next, provide a proxy server if you are using one.

If not, leave it blank and press Enter. If your network requires an HTTP proxy server, you must enter the name or address of the proxy server when prompted. This information allows your communication to be routed through the proxy server, enabling connectivity to your Spaces.

![Providing proxy server name](https://adamtheautomator.com/wp-content/uploads/2023/06/image-167.png)

Providing proxy server name

Type **Y** and press Enter to test the new configuration.

![Testing the new configuration](https://adamtheautomator.com/wp-content/uploads/2023/06/image-168.png)

Testing the new configuration

If everything is configured correctly, you will see a similar output below.

![Verifying the configuration test result](https://adamtheautomator.com/wp-content/uploads/2023/06/image-169.png)

Verifying the configuration test result

7\. Lastly, input **y** and press Enter to save the configuration in your home directory in a configuration file named _.s3cfg_.

At this point, you have S3cmd configured for use with DigitalOcean Spaces.

![Saving the configuration to a file called .s3cfg](https://adamtheautomator.com/wp-content/uploads/2023/06/image-170.png)

Saving the configuration to a file called _.s3cfg_

## Creating Buckets via the S3cmd CLI

With a well-configured S3cmd CLI, you can now access DigitalOcean Spaces to create buckets and interact with your Spaces environment.

Execute the following `s3cmd` command to create a new bucket (`mb`). This tutorial’s choice for the bucket name is `myclispacesbucket`, but you can name it differently.

```bash
s3cmd mb s3://myclispacesbucket
```

![Creating a bucket via the S3cmd CLI](https://adamtheautomator.com/wp-content/uploads/2023/06/image-171.png)

Creating a bucket via the S3cmd CLI

Now, run the below command to list (`ls`) all buckets in your DigitalOcean Spaces environment.

```bash
s3cmd ls
```

You will see the newly-created bucket in the list, as shown below if the creation is successful.

![Listing all buckets in the DigitalOcean Spaces environment](https://adamtheautomator.com/wp-content/uploads/2023/06/image-172.png)

Listing all buckets in the DigitalOcean Spaces environment

## Uploading and Downloading Objects via the S3cmd CLI

Your new Spaces bucket is available, and you are ready to start uploading objects, such as files and folders, to your bucket via the S3cmd CLI.

But can you upload multiple files simultaneously? Yes! With S3cmd CLI, you can also apply permissions to a group of objects or delete multiple objects in one go.

To see how to upload and download objects via the S3cmd CLI:

1\. Run the following `s3cmd` command to upload (`put`) a file named `myclispacesdemo.txt` (or any other file) from your local computer to one of your Spaces buckets (`myclispacesbucket`).

```bash
s3cmd put myclispacesdemo.txt s3://myclispacesbucket
```

![Uploading objects via the S3cmd CLI](https://adamtheautomator.com/wp-content/uploads/2023/06/image-173.png)

Uploading objects via the S3cmd CLI

2\. Next, run the same `s3cmd` command below with the specified names of the files (separated by spaces) to upload at once.

```bash
s3cmd put file1.txt file2.txt file3.txt s3://myclispacesbucket
```

![Uploading multiple files simultaneously](https://adamtheautomator.com/wp-content/uploads/2023/06/image-174.png)

Uploading multiple files simultaneously

3\. Execute the below command to list (`ls`) all objects (files and folders) in your bucket (`s3://myclispacesbucket`).

```bash
s3cmd ls s3://myclispacesbucket
```

Below, you can verify all files have been successfully uploaded to your bucket.

![Verifying all files have been successfully uploaded](https://adamtheautomator.com/wp-content/uploads/2023/06/image-175.png)

Verifying all files have been successfully uploaded

4\. Once verified, run the command below to download (`get`) the object named `myclispacesdemo.txt` from the `myclispacesbucket` bucket to your local computer as `mynewfile.txt`.

```bash
s3cmd get s3://myclispacesbucket/myclispacesdemo.txt mynewfile.txt
```

![](https://adamtheautomator.com/wp-content/uploads/2023/06/image-176.png)

Downloading an object from a Spaces bucket

5\. Now, run the following command to download all files and folders (`--recursive`) from your bucket (`s3://myclispacesbucket/`) to your local machine (`/tmp_dir/`).

Ensure you replace `/tmp_dir/` with your own desired local directory.

```bash
s3cmd get --recursive s3://myclispacesbucket/ /tmp_dir/
```

![Downloading multiple files](https://adamtheautomator.com/wp-content/uploads/2023/06/image-177.png)

Downloading multiple files

6\. Finally, run the `ls` command below to list the new file on your local computer.

```bash
ls -la mynewfile.txt
ls -la /tmp_dir/
```

The output below shows all files you downloaded exist in your local machine, which verifies the download succeeded.

![Verifying all downloaded files](https://adamtheautomator.com/wp-content/uploads/2023/06/image-178.png)

Verifying all downloaded files

## Conclusion

Throughout this tutorial, you learned about using the Spaces console and S3cmd to interact and manage your DigitalOcean Spaces buckets.

You can now use DigitalOcean Spaces as a powerful solution for storing and managing large objects or files. But what you have seen in this tutorial is just the beginning of what you can do with DigitalOcean Spaces.

Why not up your game and look at some of the other features? For instance, why not learn how to [set permissions](https://docs.digitalocean.com/products/spaces/how-to/set-file-permissions/) after creating a bucket or configure [versioning](https://docs.digitalocean.com/products/spaces/how-to/versioning/)?

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fdigitalocean-spaces%2F&text=Getting%20Started%20with%20DigitalOcean%20Spaces)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fdigitalocean-spaces%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fdigitalocean-spaces%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2023/01/vps-digitalocean.jpg)

### [Learn How to Create & Manage VPS DigitalOcean VMs](/vps-digitalocean/)

Learn how to use the VPS DigitalOcean platform to host VMs and develop your projects quickly and easily in this ATA Learning tutorial!

![](https://adamtheautomator.com/wp-content/uploads/publisher/2e05d9c85b2b8187b503fb0f6ceff47e/e15d54857176da3fe72b1f0692faaa7000367a5fbe6edf5f6a5f1034395fea45.webp)

### [Azure Bicep: Bulletproof Production Deployment Patterns](/azure-bicep-production-patterns/)

Own your Bicep blast radius: pin modules in a private registry, gate pull requests with lint and PSRule, and track production changes with stacks.

![](https://adamtheautomator.com/wp-content/uploads/publisher/2e05d9c85b2b819f93afc24ff9cf331a/cc243abf3399435c522e346ae33dfd425022d22b25c2f30ec3f4222e9b893e33.webp)

### [Azure DevOps Agent Pools: Fix Idle Agents and Queue Stalls](/azure-devops-idle-agents-queue-stalls/)

Diagnose idle Azure DevOps agents blocking your queue: check parallel jobs, agent demands, stuck leases, and pool scaling before you rebuild a pool.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
