If you’re like most people, you probably have a lot of digital files that you want to keep safe and accessible. But with the growing popularity of cloud storage services like Dropbox and Google Drive, it can be hard to find enough space on your computer to store all your files. Luckily, there’s an easy solution: add extra storage to your digitalOcean Droplets! Here’s how:

  1. Log in to your account on digitalOcean and click on Droplets in the top left corner.
  2. Click on the Create Droplet button in the top right corner and enter the following information: Name (e.g., my-new-droplet), Select a Region (e.g., us-east1), Select a Size (e.g., 2GB), and Click Create Droplet.
  3. Once your droplet has been created, click on it in the list of droplets and then click on Settings in the top right corner.
  4. Under Storage, click Add Storage and select an appropriate size for your files (e.g., 1GB). Then click Add Storage to add the new storage space to your droplet! ..

DigitalOcean droplets come with a limited amount of SSD storage. Here’s how you can add more disk capacity without breaking the bank, using DigitalOcean’s dedicated storage solution.

Before we continue, you should check whether resizing your droplet might be an alternative option. Switching to a larger droplet type can get you more storage space as well as a bump in CPU and RAM. This can be ideal if you’re in need of all three now but don’t expect your storage requirements to grow much further in the near future.

You can resize droplets in the DigitalOcean control panel by selecting your droplet and then clicking “Resize”. Choose “Disk, CPU and RAM” and then select the plan to upgrade to. You will need to shut your droplet down while the change is applied. Resizes involving disk capacity cannot be reversed.

Attaching a Block Storage Volume

Droplet resizes aside, DigitalOcean’s Block Storage Volumes are the simplest way to add extra storage to your servers. Volumes are SSD-driven storage units. When you add a volume to a droplet, it’s akin to connecting a physical removable drive.

The droplet will now have two storage systems available – its regular SSD and the newly created volume. You define the capacity of each volume, allowing you to tailor your storage solution. Pricing is a fixed $0.10 per GB.

You can create a volume by logging into the DigitalOcean control panel and clicking the “Volumes” link in the left sidebar. Click the blue “Create Volume” button at the top-right of the screen.

Begin by specifying the volume size to create. Use one of the prefilled defaults or click “Enter size in GB” to customise. Next, name your volume and select the droplet you’d like to attach it to.

Formatting and Mounting Volumes

You’ll now need to choose how to mount your volume. Most of the time, “Automatically Format & Mount” will get you setup with sane defaults. When this option is selected, DigitalOcean will create a formatted volume, attach it to your droplet and then mount it into the filesystem. You’re able to choose the mount point after you click “Create Volume”. DigitalOcean supports the Ext4 and XFS filesystems. Ext4 is usually the best choice, although XFS is preferred for Red Hat systems.

Choose the “Manually Format & Mount” option if you need a different filesystem. This will also give you more control over the mounting configuration as you’ll need to set it up yourself, within your droplet.

You can use the following command to mount a volume to /mnt/example-mount:

We’re assuming our volume is assigned the sda device identifier. This will usually be true of the first volume you attach to a DigitalOcean droplet. The mounting options we supply are taken from DigitalOcean’s recommended approach to mounting volumes.

Using Your Volume

Once attached, formatted and mounted, volumes become just another filesystem location on your droplet. You can copy files onto your volume with commands such as cp example-file.txt /mnt/example-volume/example-file.txt – substitute in the path you mounted your volume to.

This is no different to using any other form of mountable storage device. Anything saved within the mount location will get stored to the volume. The remainder of your droplet’s filesystem remains on its dedicated SSD as usual.

To check the disk space remaining on your droplet and volume, use the df -h command. The line with a mount point of / represents your droplet’s SSD. Your volume’s mount point will be listed too, allowing you to see how much capacity you’ve got remaining.

Managing Your Volumes

Volumes can only be attached to one droplet at a time. It is possible to reconnect to a different droplet at any point. This is useful if you’ve moving resources between droplets or decommissioning one in favour of another.

Use the Volumes page in the Control Panel to find your volume. Hover over the name of the droplet it’s connected to and click “Edit”. You can now choose a new droplet to mount the volume to.

Volumes are resized by clicking the “More” button to the right of the table. Choose “Increase size” and select the new capacity to use. Volumes can only ever be resized upwards so the change will not be reversible.

Volume Backups

Volumes support DigitalOcean’s Snapshots system for backups. This mechanism lets you save a complete disk image into your DigitalOcean account.

Click the “More” button next to any volume and click “Take snapshot”. Use the dialog to name your snapshot and then press “Take Snapshot” to confirm. The process may take several minutes to complete. Larger droplets will require much more time.

You can use snapshots to recover your data at any future time. Click the “Images” link in the sidebar and find the snapshot you want to use. You can restore the snapshot to the volume it originated from or create a new volume with the snapshot as its base.

Snapshots you create are stored in perpetutity in your account. They’re billed at $0.05/GB/mo. You only pay for the data within each snapshot, not the size of the volume it originated from.

Conclusion

DigitalOcean’s Volumes allow you to easily add more storage to an existing droplet. The automated formatting and mounting process makes setup an extremely straightforward process.