How To Create and Manage Your First DigitalOcean Space
DigitalOcean Spaces allow you to store and serve large amounts of data. You can create them in a few seconds and use them immediately with no configuration. They're ideal for storing unstructured data like audio, video, and images as well as large amounts of text.
However, Spaces are an object storage implementation and things like databases, applications written in server-side languages, and mission-critical applications should use local storage or block storage. You can visit Object Storage vs. Block Storage to learn more about the differences between the two.
In this article, you'll use the DigitalOcean Control Panel to create your first Space, then learn how to manage files within it. You'll upload new files, change their permissions, organize them, and delete them.
To follow along, you will need:
- A DigitalOcean account. If you don't already have one, you can register on the sign up page.
We'll be uploading several files during this tutorial. You can download the files that this tutorial uses and use them in the examples as you follow along, or you can substitute your own files.
Once you've logged into the Control Panel, you're ready to begin.
Creating a Space
Navigate to the Spaces page by selecting it from the top navigation bar. This will take you to the main page, where you can create your first Space. As you'll see in a moment, once we have at least one Space, this page will serve as the overview for all your account's Spaces.
Next, click the Create a space button, which will take you to the creation page:
You will have three choices to make:
Choose a unique name
The name can be between three and sixty-three characters long. It can contain only letters, numbers, and dashes, and must begin with a letter or number. Most importantly, names must be unique among all DigitalOcean Space names across all users in all regions. If the name is already in use, a message will appear which says Space already exists. The name of the Space makes up part of its URL and cannot be changed once it is created.
Choose a region
Choose the datacenter region where your Space will be located. As new datacenters become available, they will appear on the list.
This setting is Space-wide and determines who can list its contents. This won't have any effect on the visibility of the files themselves. You can change this value once the Space has been created on its Settings tab. For more details about the implications of this setting, see Managing Access to DigitalOcean Spaces.
Choose a name, region, and access level for your Space. In this example, we'll call our Space
space-one and accept the Private access setting default:
When you're done, click Create a Space. This will take you from the main page to the root of
The very first time you create a Space in an account, it will contain a
welcome.html file. This file will appear once and won't be created again, even if we delete all the Spaces and start over.
Working with Individual Files
To upload a single file, click the Upload File button, which lets you select files in two ways:
- You can drag and drop, which allows you to upload files, folders, and items nested inside folders.
- Alternately, you can locate files using a selection dialog, then upload them. This lets you upload one or more files from a single folder, but this method doesn't support uploading folders themselves.
Step 1 — Uploading an Individual File
sammy-balloon.png by selecting it from our local machine:
When we click Open, the file is staged for upload and the dialog stays open, allowing us to add more files if we wish. We're also given the option of setting the permissions, which apply to all the files that have been staged. For now, we're going leave the permissions set to Private so we can explore the default behavior.
Step 2 — Verifying the Default Permissions
Once the file is uploaded, we will mouse over it and copy the URL to view it in a web browser. The tooltip that opens shows us that the file is private and that its Content-Type metadata was detected accurately and set to
Next, we'll open a second browser window, and paste the link we copied into the location bar to confirm that our file won't be displayed to anonymous visitors.
<Error> <Code>AccessDenied</Code> <BucketName>space-one</BucketName> <RequestId>tx00000000000000385e4da-0059bad671-1067e-nyc3a</RequestId> <HostId>1067e-nyc3a-nyc</HostId> </Error>
This AccessDenied message verifies that our image is indeed private.
In the next step, we'll update the permissions to make Balloon Sammy publicly visible.
Step 3 — Changing the File's Permissions
We'll return to
space-one in our first browser window and use
sammy-balloon.png's More menu to change the permissions. This menu also allows us to manage metadata, rename the file, move it to a folder, generate a Quick Share link, or download it to our local machine. For more information on these actions, see An Introduction to DigitalOcean Spaces.
We'll select Manage Permissions:
From there, we'll make the file Public and click Update.
Now that the permissions are changed, we'll verify the file is visible by reloading it in our second browser window:
Step 4 — Deleting an Individual File
We no longer need the
welcome.hmtl file, so we'll remove it by opening its More menu, clicking Delete and confirming that we really mean it:
Folders can be deleted in the same way, i.e.,by accessing their individual More menu. Note that all the contents within the folder will be deleted as well.
Working with Multiple Files
So far, we've worked with individual files and folders. Next, we'll stage multiple files and use the Actions menu to organize our work.
Whether we add files using drag and drop functionality, the selection dialog, or a combination of the two, the Upload Files window stays open so we can continue adding files until we're ready to upload. Once we've uploaded multiple files, we can manage them more efficiently by using the Actions menu.
Step 1 — Uploading Multiple Files and Folders
Because selecting from our local machine is limited to choosing one or more files from the same folder, we'll upload the
sticker folder and the other files by dragging and dropping them all. This will stage all of the contents in a single step:
The files, folder, and the folder's contents will be staged for upload. The Remove link will let us unstage files or folders. Note that a folder and its contents are treated as a unit. The Remove link will unstage the folder and all the files and folders within it.
We'll keep all the files we've staged, set the permissions set to Public, and select Upload.
The Space now displays the files:
Step 2 — Using the Actions Menu
When we have two or more items we want to change, we can use the Actions menu. The options available to us will be different depending what we select.
For example, if we select our two images, we can manage permissions and metadata, move them to a folder, or delete them.
However, if we also select the folder, then our options will be limited to moving the selected items to a folder or deleting them.
This is a side effect of object storage having no actual folders, which we discuss in detail in An Introduction to DigitalOcean Spaces. It's not possible to set permissions or add metadata to them.
In the next step, we'll use the Action menu to place the images in a folder.
Step 3 — Moving Items to a New Folder
We'll select only the four Sammy images, then open the Action menu and select Move to Folder. In the dialog that opens, we'll highlight
spaces-intro to indicate that's where we want to make a new folder. That will activate the New Folder option.
We'll click New Folder, rename it from
images, and select Move Here. When the move is complete, the
images folder will be located at the root of the Space.
We'll click into the
images folder to verify that the files have been moved:
Step 4 — Deleting Multiple Files and Folders
We'll finish this guide by using the Actions menu to delete our example files. First, we'll use the breadcrumbs to navigate to the root of the Space:
From there, we'll check the box next to the Name header, which will check all the boxes below:
Then, we'll open the Actions menu, click Delete, and confirm we really mean it by clicking Delete 2 items:
This will delete all the files and folders.
In this guide, we explored using the Control Panel to create and manage Spaces. To learn more about using the Control Panel visit An Introduction to DigitalOcean Spaces.