We hope you find this tutorial helpful. In addition to guides like this one, we provide simple cloud infrastructure for developers. Learn more →

How To Tag DigitalOcean Droplets

UpdatedJanuary 23, 2018 13.6k views DigitalOcean Product Documentation

Introduction

DigitalOcean offers tags, a feature allowing you to apply custom labels to a Droplet. You can tag more than one Droplet with the same label, then use it to view a filtered list of Droplets that share that particular tag. In addition to filtering, the DigitalOcean API allows you to initiate an action across multiple Droplets with the same tag. Identifying groups of Droplets and administering all of them at once reduces the time required to manage resources.

Tags can also be used to automatically include Droplets in a Firewall or Load Balancer configuration, minimizing administration required when adding a new Droplet to your account.

Tagging a Droplet from the Droplets page

To begin, log into the DigitalOcean Control Panel and open the More menu to the right of the Droplet that you want to tag, then choose Add tags.

More Option

An Add Tags overlay window appears. In the Type tags here input box, enter a label to tag the Droplet. Choosing terms that describe what function a Droplet serves will help you to locate and administer the Droplets that share common roles. We have found that developers consider some of the following when tagging Droplets:

  • Environment - Production, Staging or Development
  • Application - Web server (Apache), Database server (MariaDB), et cetera
  • Purpose - A project name or any other key term that describes the use of the Droplet
  • Person - The individual or team responsible for managing the Droplet

Add multiple terms by pressing the SPACEBAR or ENTER key after each one.

Add Tags

With your desired tag in place, click the Save Tags button.

Save Tags

You will return to the Droplets section of the Control Panel where a Tags column now exists.

Droplets Again

Additionally, when a Droplet has multiple tags assigned to it, the first one appears in the Tags column followed by a plus symbol and the number of additional tags. Clicking on the number reveals the other tags.

Multiple Tags

At this point, you have completed the necessary steps to tag a Droplet. You can edit the tags by performing the same actions.

Tagging a Droplet by Selecting it

You can also access the tags option by clicking on the name of a Droplet from the Droplet section of the Control Panel:

Note: The following screenshots reflect assigning a tag to a Droplet for the first time.

Droplets

The new page contains a list of option on the left-hand side. Click Tags at the bottom.

Droplet Options

Next, click the Add Tags button.

Tags

In the Add Tags input box, enter a label to tag the Droplet and click the Save Tags button.

Save Tags

You will return to the Droplets section of the Control Panel where the Tags column now displays the tag(s) you created.

Tags Added

Click the Droplets link in the top-left corner of the page to go back to the Droplets page.

Droplets Again

Tagging a Droplet during Creation

When you create a new Droplet, you can label it as well. Open the Create menu in the top-right corner of any page and choose Droplets.

At the bottom of the page in the Choose a hostname portion of the Finalize and create section, click the Add Tags link.

Add Tags

In the Type tags here field, enter a label to tag the Droplet.

Enter Tags

Next, click the Create button.

We have now explored the three avenues for working with tags in the DigitalOcean control panel.

Filtering Droplets by a Tag

From the Droplets page, select a tag shared by multiple Droplets.

Multiple Droplets

Presented is a filtered list of Droplets based on that tag assignment.

Filtered Droplets

Using Tags for Firewall and Load Balancers

Tags can also simplify configuration of DigitalOcean Firewalls and Load Balancers. By configuring your Load Balancer or Firewall to include a Tag, it will automatically include all Droplets with that Tag assigned without the need to manually add the specific Droplets to the Firewall or Load Balancer configuration. This provides an easy, automated method to configure Firewalls and Load Balancers when you create a new Droplet. How To Create Your First DigitalOcean Cloud Firewall provides a full example of how to use Tags for your Firewall and Load Balancer configurations.

Conclusion

In this tutorial, we covered navigating the DigitalOcean Control Panel and assigning a tag to a Droplet. After tagging your Droplets, you can begin using them with the DigitalOcean API. For more information about tags and our API, please view our How To Use Droplet Tagging with the DigitalOcean API tutorial.

6 Comments

Creative Commons License