How to Create a Container Registry

The DigitalOcean Container Registry (DOCR) is a private Docker image registry that lets you store and manage private container images. DOCR integrates natively with Docker environments and DigitalOcean Kubernetes clusters.


You can create a new container registry using the control panel, API, or CLI. It requires a name, datacenter region, and subscription plan.

After creating a registry, you can configure it to push and pull from Docker and DigitalOcean Kubernetes.

Create a Container Registry Using the Control Panel

After you log in to the control panel, click Container Registry in the left sidebar, then click the Create a Container Registry button.

Name Your Container Registry

Enter a custom name for your container registry. Names must be unique, be between 3 and 63 characters long, and only contain alphanumeric characters and dashes. You cannot change a registry’s name after creation.

The name selection text box

Choose a Datacenter Region

Use the region dropdown menu to select your registry’s datacenter region. For the best performance, we recommend you select a region close to your other DigitalOcean resources.

The datacenter dropdown menu

Choose a Plan

Choose your subscription plan. The Starter plan is free, to test out the product. The Basic plan includes multiple repositories and 5GiB storage. The Professional plan includes unlimited repositories and 100GiB of storage. For more details on the different plans, see the pricing page.

The plan selection menu

Create Registry

Create the registry by clicking Create Registry.

Once your registry is created, you can view information such as stored images and monitor unused data in the Repositories tab.

Create a Container Registry Using the API

How to Create a Container Registry Using the DigitalOcean API
  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/registry

    cURL

    Using cURL:

                                curl -X POST \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
      -d '{"name": "example", "subscription_tier_slug": "basic", "region": "fra1"}' \
      "https://api.digitalocean.com/v2/registry"
                            

    Python

                                import os
    from pydo import Client
    
    client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
    
    req = {
      "name": "example",
      "subscription_tier_slug": "basic",
      "region": "fra1"
    }
    
    resp = client.registry.create(body=req)
                            

Create a Container Registry Using the CLI

How to Create a Container Registry Using the DigitalOcean CLI
  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, run doctl registry create. Basic usage looks like this, but you can read the usage docs for more details:

                    doctl registry create <registry-name> [flags]
                

    The following example creates a registry named example-registry in the NYC3 region:

                        doctl registry create example-registry --region=nyc3
                    
In this article...