How to Create a Droplet

DigitalOcean Droplets are Linux-based virtual machines (VMs) that run on top of virtualized hardware. Each Droplet you create is a new server you can use, either standalone or as part of a larger, cloud-based infrastructure.


Create a Droplet in the Control Panel

The Droplet create page is where you choose your Droplet’s configuration, like its operating system, how much memory it has, and which features (like backups or monitoring) to enable. The most popular defaults are pre-selected, so you can scroll to the bottom of the page and create a Droplet immediately, or you can customize any of the options in each section.

To access the DigitalOcean Control Panel and create a Droplet, you need a DigitalOcean account. You can create one from the DigitalOcean new account registration page if you don’t already have one.

After you log in to the control panel, click the green Create button in the top right to open the create menu.

Create menu

In the create menu, click Droplets to open the Droplet create page. If you don’t have any Droplets, the Resources tab displays a large, blue Get Started with a Droplet button, which takes you to the same Droplet create page.

Choose Region

In the Choose Region section, select the region where you want to create your Droplet.

A good default is selected for you, but for the best performance and minimal latency, choose the datacenter nearest to you and your users. You can also make a decision based on which products and features are available in which regions.

The Choose Region section of the Droplet creation page.

The create page greys out datacenters that are incompatible with your selected configuration and adds a tooltip with an explanation. For example, if you add a block storage volume to your configuration, you cannot create your Droplet in a datacenter that doesn’t support volumes.

This section also lists the default VPC network for the Droplet. The VPC network enables an additional networking interface that can only be accessed by other Droplets within the same datacenter. This keeps traffic between Droplets and other applicable resources from being routed outside the datacenter over the public internet.

Choose an image

In the Choose an image section, you choose the image to use for your Droplet:

The Choose an image section of the Droplet creation page

Initially, you can choose from four categories of images:

  • OS includes basic Unix-like images with no additional software (like Ubuntu, Fedora, and Debian).

  • Marketplace images include pre-configured applications, like Docker, WordPress, or LAMP, to help simplify getting started.

    Some Marketplace images, like WordPress, let you add a managed database cluster during creation. Connection credentials for the database cluster are available in the control panel, in a file on the Droplet (/root/.digitalocean_dbaas_credentials, and MongoDB certificates at /root/dbaas_ca_cert.crt), and are exported as environment variables on the Droplet from /etc/environment.

  • Custom images are Unix-like images that you create and upload to your DigitalOcean account.

Once you start using Droplets, you can make backups and take snapshots of them. On the Droplet creation page, tabs for Backups and Snapshots list the backups and snapshots you’ve taken, if any. You can choose those images as the foundation to create new Droplets.

  • Snapshots are on-demand Droplet and volume images. They’re useful to manually back up or reproducibly create Droplets.

  • Backups are automatic system-level backups. We retain 4 weeks of backup images, and you can use them as a basis to rebuild an existing Droplet.

Choose Size

In the Choose Size section, you choose the amount of RAM, storage space, and CPU cores for your Droplet.

The Choose Size section of the Droplet creation page.

There are five types of plans:

  • Basic Droplets, a flexible option best for most use cases, like website hosting, staging environments and low intensity compute needs.

  • General Purpose Performance Droplets, a robust option suitable for a wide variety of mainstream, production applications that require a higher ratio of memory to CPU.

  • CPU-Optimized Performance Droplets, best for CPU intensive tasks and projects that require predictable performance or rely on CPU more than RAM or I/O, like batch processing large data sets, large builds, and video encoding. You can also choose between Regular and Premium Intel CPUs. Premium CPU plans come with some of our most modern Intel CPUs, NVMe SSDs, and higher network throughput speeds.

  • Memory-Optimized Performance Droplets, best for resource-intensive business applications, like high-performance SQL or NoSQL databases, large in-memory caches and indexes, real-time big data processing, and applications with large JVM requirements.

  • Storage-Optimized, best for large NoSQL databases (like MongoDB and Elasticsearch), time series databases, and other data warehouses.

For each plan, you can choose Regular and Premium CPUs. Premium CPU plans come with some of our most modern Intel or AMD CPUs and NVMe SSDs, as well as higher bandwidth throughput.

See How To Choose a Droplet Plan for an in-depth guide to choosing a Droplet plan.

Note
For Droplets with less than 3 GB of RAM, we recommend using a 32-bit operating system. Processes require more memory on 64-bit architectures, and on servers with a limited quantity of RAM, any performance benefits from a 64-bit OS are offset by having less memory available for buffers and caching.

Additional Storage

In the Additional Storage section, you can create and attach additional DigitalOcean Volumes Block Storage volumes to your Droplet. When you click Add Volume, you can specify the details of the volume you want to create:

The Additional Storage section of the Droplet creation page.

Volumes are independent resources that can be moved from one Droplet to another within the same datacenter. Attached volumes function like locally connected storage drives, meaning you can manage your storage with familiar tools and techniques.

Enable Backups

You can turn on automatic backups for the Droplet. This adds a cost to the Droplet’s price depending on the frequency of the backups.

In the recommended options section, check Enable automated backups.

Here, you can select Weekly Backups or Daily Backups. Daily backups are in early availability for Droplets in NYC1, NYC3, SFO3, AMS3, and SGP1.

The backup window is a 4-hour window of time during which the Droplet automatically initiates a new backup. In the Backup Window section, use the dropdown menus to customize your Droplet’s backup window by choosing a time of day and, for weekly backups, a day of the week.

If you’re using the API to create a Droplet, you can enable backups by adding "backups": true to the request body.

Choose Authentication Method

In the Choose Authentication Method section, you choose the method you want to use to log in to your Droplet. The Choose Authentication Method section of the Droplet creation page. There are two options:

  • SSH key, which provide more security than a password.

  • Password, which allows you to create your own password for the new Droplet. If you choose to use SSH keys, you need to select at least one key to add to the Droplet. Any keys you’ve already uploaded to your DigitalOcean account are listed.

Check the boxes next to the existing keys you want to add to the Droplet, or check Select all to add every key on your account. You can also click New SSH Key to upload a new key to your account from the create page.

Once you create and upload an SSH key to your DigitalOcean account, it remains available for you to add to any new Droplets you provision in the future.

In the We recommend these options section, you can enable several optional services that add functionality to your Droplet.

The recommended options section of the Droplet creation page.

Most features available in this section are free, meaning that enabling them does not increase the Droplet’s monthly cost:

There are additional options available by expanding +Advanced Options:

The advanced options section of the Droplet creation page.
  • IPv6 (free) enables IPv6 access for your Droplet.

  • User data (free) is arbitrary data that you specify which is written to the user-data field of the DigitalOcean metadata service. Droplets running distributions with cloud-init can consume and execute the data from this field, which are generally cloud-config files used for initially configuring a server on first boot.

Finalize Details

In the Finalize Details section, you specify the quantity, name, tags, and project for the Droplet you’re creating.

The Finalize Details section of the Droplet creation page.

There are four subsections for these options:

  • Quantity, where you choose the quantity of Droplets you’re creating with the specified configuration. Adjust the number by clicking the plus, +, or minus, -, buttons.

  • Hostname, where you give each Droplet a name which is used in the control panel and as the server’s hostname. Default names are provided based on the options you selected, but you can modify them to suit your needs.

    Note
    Using an FQDN (fully qualified domain name) (for example, droplet1.example.com) as the Droplet’s name automatically generates PTR records for your Droplet based on that name. This also applies if you rename a Droplet after creation.
  • Tags, where you can add tags to organize and relate Droplets.

  • Project, where you can assign the Droplet to a project.

Once you have selected your options, click Create Droplet. A progress bar displays how close your Droplet is to being ready.

Screenshot of progress bar

You can also click Create via command line to get a command that you can copy and paste onto the command line to create Droplets with the configuration you selected. You can choose from two libraries: cURL and doctl, the offiical DigitalOcean command line utility.

Once the Droplet is fully set up, the control panel displays its IP address.

Screenshot of installed Droplet

Once you see the IP address, you can log in to your Droplet.

To go to a Droplet’s detail page where you can make changes, click its name or go straight to the task you want using the More menu. You can also get a quick view of the Droplet’s details by clicking the icon by the Droplet’s name.

Screenshot of Droplet with expanded information

Create a Droplet Using the CLI

When creating a Droplet via CLI, you need to provide values for the --region, --size, and --image flags, which specify the desired datacenter, machine size, and operating system for your new Droplet. Use doctl compute region list, doctl compute size list, and doctl compute image list-distribution, respectively, to get a list of available values.

How to create a Droplet using the DigitalOcean CLI

To create a Droplet via the command-line, follow these steps:

  1. Install doctl, the DigitalOcean command-line tool.

  2. Create a personal access token, and save it for use with doctl.

  3. Use the token to grant doctl access to your DigitalOcean account.

                  doctl auth init
                
  4. Finally, create a Droplet with doctl compute droplet create. The basic usage looks like this, but you'll want to read the usage docs for more details:

                  doctl compute droplet create <droplet-name>... [flags]
                

    The following example creates a Droplet named example-droplet with a two vCPUs, two GiB of RAM, and 20 GBs of disk space. The Droplet is created in the nyc1 region and is based on the ubuntu-20-04-x64 image. Additionally, the command uses the --user-data flag to run a Bash script the first time the Droplet boots up

                       doctl compute droplet create example-droplet --size s-2vcpu-2gb --image ubuntu-20-04-x64 --region nyc1 --user-data $'#!/bin/bash\n touch /root/example.txt; sudo apt update;sudo snap install doctl'
                    

Create a Droplet Using the API

When creating a Droplet via API you need to provide values for region, size, and image, which specify the desired datacenter, machine size, and operating system for your new Droplet. Use /v2/regions, /v2/sizes, and /v2/images, respectively, to get a list of available values.

How to create a Droplet using the DigitalOcean API

To create a Droplet using the DigitalOcean API, follow these steps:

  1. Create a personal access token, and save it for use with the API.

  2. Send a POST request to https://api.digitalocean.com/v2/droplets

    cURL

    To create a Droplet with cURL, call:

    
                    curl -X POST \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
      -d '{"name":"example.com","region":"nyc3","size":"s-1vcpu-1gb","image":"ubuntu-20-04-x64","ssh_keys":[289794,"3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45"],"backups":true,"ipv6":true,"monitoring":true,"tags":["env:prod","web"],"user_data":"#cloud-config\nruncmd:\n  - touch /test.txt\n","vpc_uuid":"760e09ef-dc84-11e8-981e-3cfdfeaae000"}' \
      "https://api.digitalocean.com/v2/droplets"

    Go

    Go developers can use Godo, the official DigitalOcean V2 API client for Go. To create a Droplet with Godo, use the following code:

    
                    import (
        "context"
        "os"
    
        "github.com/digitalocean/godo"
    )
    
    func main() {
        token := os.Getenv("DIGITALOCEAN_TOKEN")
    
        client := godo.NewFromToken(token)
        ctx := context.TODO()
    
        createRequest := &godo.DropletCreateRequest{
            Name:   "example.com",
            Region: "nyc3",
            Size:   "s-1vcpu-1gb",
            Image: godo.DropletCreateImage{
                Slug: "ubuntu-20-04-x64",
            },
            SSHKeys: []godo.DropletCreateSSHKey{
                godo.DropletCreateSSHKey{ID: 289794},
                godo.DropletCreateSSHKey{Fingerprint: "3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45"}
            },
            Backups: true,
            IPv6: true,
            Monitoring: true,
            Tags: []string{"env:prod","web"},
            UserData: "#cloud-config\nruncmd:\n  - touch /test.txt\n",
            VPCUUID: "760e09ef-dc84-11e8-981e-3cfdfeaae000",
        }

    Ruby

    Ruby developers can use DropletKit, the official DigitalOcean V2 API client for Ruby. To create a Droplet with DropletKit, use the following code:

    
                    require 'droplet_kit'
    token = ENV['DIGITALOCEAN_TOKEN']
    client = DropletKit::Client.new(access_token: token)
    
    droplet = DropletKit::Droplet.new(
      name: 'example.com',
      region: 'nyc3',
      size: 's-1vcpu-1gb',
      image: 'ubuntu-20-04-x64',
      ssh_keys: [289794,"3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45"],
      backups: true,
      ipv6: true,
      monitoring: true,
      tags: ["env:prod","web"],
      user_data: "#cloud-config\nruncmd:\n  - touch /test.txt\n",
      vpc_uuid: "760e09ef-dc84-11e8-981e-3cfdfeaae000",
    )
    client.droplets.create(droplet)

    Python

    
                    import os
    from pydo import Client
    
    client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
    
    req = {
      "name": "example.com",
      "region": "nyc3",
      "size": "s-1vcpu-1gb",
      "image": "ubuntu-20-04-x64",
      "ssh_keys": [
        289794,
        "3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45"
      ],
      "backups": True,
      "ipv6": True,
      "monitoring": True,
      "tags": [
        "env:prod",
        "web"
      ],
      "user_data": "#cloud-config\nruncmd:\n  - touch /test.txt\n",
      "vpc_uuid": "760e09ef-dc84-11e8-981e-3cfdfeaae000"
    }
    
    resp = client.droplets.create(body=req)