---
title: "Learn How to Create & Manage VPS DigitalOcean VMs"
description: "Learn how to use the VPS DigitalOcean platform to host VMs and develop your projects quickly and easily in this ATA Learning tutorial!"
canonical: "https://adamtheautomator.com/vps-digitalocean/"
---

# Learn How to Create & Manage VPS DigitalOcean VMs

> Learn how to use the VPS DigitalOcean platform to host VMs and develop your projects quickly and easily in this ATA Learning tutorial!

Source: https://adamtheautomator.com/vps-digitalocean/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Learn How to Create & Manage VPS DigitalOcean VMs](https://adamtheautomator.com/wp-content/uploads/2023/01/vps-digitalocean.jpg)

# Learn How to Create & Manage VPS DigitalOcean VMs

[![](https://secure.gravatar.com/avatar/1bc5e1d52466fc3739f550c8d78be310684747bf1466a98d698320627ea243e2?s=192&d=mm&r=g)Michael Nguyen Tu](https://adamtheautomator.com/author/michael-nguyen-tu/)6 January 20237 min. read

Categories: [DevOps](/category/devops/)

Tags:[DigitalOcean](/tag/digitalocean/)[Virtualization](/tag/virtualization/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Creating a VPS DigitalOcean via the Cloud Control Panel](#creating-a-vps-digitalocean-via-the-cloud-control-panel)
*   [Creating a VPS via the DigitalOcean API](#creating-a-vps-via-the-digitalocean-api)
*   [Testing Your DigitalOcean VPS](#testing-your-digitalocean-vps)
*   [Managing Your DigitalOcean VPS](#managing-your-digitalocean-vps)
*   [Conclusion](#conclusion)

As businesses move to the cloud, the demand for Virtual Private Server (VPS) hosting services increases. If you are on the lookout for a VPS DigitalOcean (DO) offers one that provides a secure and robust platform.

A DigitalOcean VPS lets you deploy applications in a shared environment without sacrificing performance or scalability. And in this tutorial, you will learn the basics of DigitalOcean VPSs, how to set one up, and how to manage it.

Read on and get your Virtual Private Server running in no time!

## Prerequisites

This tutorial will be a hands-on demonstration. To follow along, be sure you have the following:

*   A DigitalOcean [account](https://cloud.digitalocean.com/registrations/new) with active billing – A [free trial](https://try.digitalocean.com/freetrialoffer/) will suffice.
*   A Linux machine – This tutorial uses Debian 10, but other distributions will work.

## Creating a VPS DigitalOcean via the Cloud Control Panel

Whether you manage personal websites, business websites (small to medium-sized), or eCommerce marketplaces, VPS hosting is an excellent platform. But before diving into hosting, you first need to create a VPS.

There are two different ways you can create a VPS in DigitalOcean. But for a start, you will create one via the Cloud Control Panel, an intuitive GUI web-based control panel. This control panel lets you quickly create, modify, and manage your VPSs.

1\. Open your favorite web browser, and log in to the [DO Control Panel](https://cloud.digitalocean.com/droplets).

> 💡 _By default, you will see all your existing VMs listed. Otherwise, if no VMs exists, you will only see an empty page._

2\. Next, click **Create Droplet**, as shown below, to initiate creating a VPS ([Droplet](https://docs.digitalocean.com/products/droplets/)).

![VPS Digitalocean - Initiating creating a VPS](https://adamtheautomator.com/wp-content/uploads/2023/01/image-81.png)

Initiating creating a VPS

3\. Choose a **Region** and **Datacenter** for your Droplet:

<table><tbody><tr><td>Region</td><td>A region that is close to your target audience to minimize latency.</td></tr><tr><td>Data Center</td><td>A region that is close to your target audience to minimize latency.</td></tr></tbody></table>

> 💡 _Review the [Regional Availability Matrix](https://docs.digitalocean.com/products/platform/availability-matrix/#app-platform-availability) before deciding on the region and data center to ensure the services you need are available in the region._

![Choosing a region and datacenter](https://adamtheautomator.com/wp-content/uploads/2023/01/image-82.png)

Choosing a region and datacenter

4\. Choose an operating system (OS) template and version (dropdown field).

This tutorial uses [Ubuntu 20.04](https://adamtheautomator.com/install-ubuntu/), but ensure you choose an image compatible with your application stack and regularly updated with security patches.

Related:[How to Install Ubuntu 20.04 \[Step-by-Step\]](https://adamtheautomator.com/install-ubuntu/)

![Choosing an image for the Droplet](https://adamtheautomator.com/wp-content/uploads/2023/01/image-83.png)

Choosing an image for the Droplet

5\. Choose the size of your Droplet, which determines the amount of RAM, CPU, and disk space available to your application.

> 💡 _With_ DigitalOcean’s [resize feature](https://docs.digitalocean.com/products/droplets/how-to/resize/), you can always upgrade or downgrade your VM if needed. But choosing the correct size is best since resizing can be disruptive and may cause downtime.

The size of your droplet will affect the [cost of your Droplet](https://www.digitalocean.com/pricing/droplets), so ensure you choose a cost-effective size for your use case. For example, choose the smallest size if you run a small web application.

This tutorial uses the **Basic SHARED CPU** and **Regular CPU** option (**SSD**) with one (**1**) **CPU**, **1 GB** RAM, and **25 GB SSD Disk**.

![Choosing a Droplet size](https://adamtheautomator.com/wp-content/uploads/2023/01/image-84.png)

Choosing a Droplet size

6\. Choose either to use a **Password** or **SSH Keys** to access your server. This tutorial uses the **Password** authentication method for simplicity.

<table><tbody><tr><td><strong>Authentication Method</strong></td><td><strong>Description</strong></td></tr><tr><td>SSH Key</td><td>SSH keys are a secure way to authenticate when connecting to your Droplet. This method uses cryptographic keys and is more secure than password authentication. To use SSH keys, you need to <a href="https://docs.digitalocean.com/products/droplets/how-to/connect-with-ssh/" target="_blank" rel="noreferrer noopener">generate a public and private key pair</a> and then add the public key to your Droplet.</td></tr><tr><td>Password</td><td>SSH keys are a secure way to authenticate when connecting to your Droplet. This method uses cryptographic keys and is more secure than password authentication. To use SSH keys, you need to <a href="https://docs.digitalocean.com/products/droplets/how-to/connect-with-ssh/" target="_blank" rel="noreferrer noopener">generate a public and private key pair</a> and then add the public key to your Droplet.</td></tr></tbody></table>

Provide a strong password (including upper and lower case letters, numbers, and special characters.) in the **Create root password** field, as shown below.

Since DigitalOcean only shows the password once, save it somewhere safe, as you will need it later.

![Selecting an authentication method (Password)](https://adamtheautomator.com/wp-content/uploads/2023/01/image-85.png)

Selecting an authentication method (Password)

7\. Next, input a unique and descriptive Hostname to identify your Droplet.

![Providing a hostname for the Droplet](https://adamtheautomator.com/wp-content/uploads/2023/01/image-86.png)

Providing a hostname for the Droplet

8\. Finally, keep other settings as is, and click **Create Droplet** (bottom-right) to start creating your Droplet.

![Creating the new Droplet ](https://adamtheautomator.com/wp-content/uploads/2023/01/image-87.png)

Creating the new Droplet

Depending on the size and plan you selected, the Droplet creation may take a few minutes.

![Viewing the Droplet creation progress ](https://adamtheautomator.com/wp-content/uploads/2023/01/image-88.png)

Viewing the Droplet creation progress

Once the Droplet is created, you will see all resources in your project, including the newly-created Droplet, as shown below.

Congratulation! You have created your first VPS in DigitalOcean that you can now use to host your application.

![Verifying the newly-created Droplet/VPS](https://adamtheautomator.com/wp-content/uploads/2023/01/image-89.png)

Verifying the newly-created Droplet/VPS

## Creating a VPS via the DigitalOcean API

Not a fan of clicking around the DigitalOcean control panel each time you need to complete a task? Or perhaps you prefer to use a Continuous Integration Continuous Delivery (CI/CD) tool for automating your workflow?

Luckily, DigitalOcean offers a comprehensive API that lets you quickly interact with the [DigitalOcean API](https://docs.digitalocean.com/reference/api/api-reference/) to manage Droplets and resources within the DigitalOcean cloud.

Related:[How to Create a Jenkins CI CD Pipeline](https://adamtheautomator.com/jenkins-ci-cd/)

To create a VPS via CLI, you first need a personal access token to authenticate your requests:

1\. Navigate to the [Applications & API panel](https://cloud.digitalocean.com/account/api/tokens) (log in if prompted).

2\. Next, click **Generate New Token**, which opens a window where you can configure your token.

![Click the Generate New Token button.](https://adamtheautomator.com/wp-content/uploads/2023/01/image-90.png)

Click the **Generate New Token** button.

On the next page, configure the following for your token:

*   **Token name –** Provide a descriptive token name (i.e., vps-digitalocean-token), but ensure you avoid including sensitive information.
    
*   **Expiration** – Choose a certain time when the token will expire or remain valid until you delete it. If you only need temporary access to the API, choose a shorter expiration date. Otherwise, choose a longer expiration period.
    

> _Note that choosing a shorter expiration date may require you to generate a new token more frequently. This scenario can be time-consuming and may disrupt your workflow. 30 days is a good balance between security and convenience._

*   **Select scopes** – Select the **Write** scope for this tutorial to create a droplet using the CLI. Remember to choose the minimum scope necessary to perform the actions you need. Doing so reduces the risk of unintended actions or mistakes and improves your API access security.

Once configured, click **Generate Token** to finalize creating your personal access token.

![Generating a personal access token](https://adamtheautomator.com/wp-content/uploads/2023/01/image-91.png)

Generating a personal access token

4\. Now, copy the token, as shown below, and save it in a secure location. You will need this token to authenticate your requests and create a Droplet via the API.

![Copying the generated personal access token](https://adamtheautomator.com/wp-content/uploads/2023/01/image-92.png)

Copying the generated personal access token

5\. Open your terminal, and run the following [`apt install`](https://linuxize.com/post/how-to-use-apt-command/#installing-packages-apt-install) command to install `curl`. You will use cURL to communicate with the DigitalOcean API.

Related:[Essential CURL API Commands for Testing & Troubleshooting](https://adamtheautomator.com/curl-api/)

```bash
sudo apt install curl -y
```

![](https://adamtheautomator.com/wp-content/uploads/2023/01/image-93.png)

Installing cURL

Related:[Learning Ubuntu Apt Get Through Examples](https://adamtheautomator.com/ubuntu-apt-get/)

6\. Next, run the below command to `EXPORT` your token to an environment variable. Doing so lets you avoid entering the token manually each time you authenticate your requests.

Ensure you replace `MY_TOKEN` with your preferred environment variable name and `Your_Access_Token` with your personal access token.

```javascript
EXPORT MY_TOKEN="Your_Access_Token"
```

![Exporting the token to an environment variable](https://adamtheautomator.com/wp-content/uploads/2023/01/image-94.png)

Exporting the token to an environment variable

7\. Once exported, run the `echo` command below to check if the token is correctly set.

```javascript
echo $MY_TOKEN
```

The output would include your token if the token was successfully exported, as shown below.

![Checking if the token is correctly set](https://adamtheautomator.com/wp-content/uploads/2023/01/image-95.png)

Checking if the token is correctly set

8\. Now, run the below `curl` command to send an HTTP POST request to the DigitalOcean API to create a new Droplet (`ubuntu-cli`). This tutorial’s choice for the Droplet name is `ubuntu-cli`, but you can choose a different name.

This new Droplet will be configured as follows, but you can replace the [image, size, and region](https://slugs.do-api.dev/) as needed to customize yours.

*   Based on Ubuntu 20.04 (`"image":"ubuntu-20-04-x64"}`).
    
*   Have one vCPU and 1GB of RAM (`size":"s-1vcpu-1gb"`).
    
*   Located in the New York data center (`"region":"nyc3"`).
    

```bash
# Sends an HTTP POST request.
# Tell the server that the request's body will be JSON.
curl -X POST -H 'Content-Type: application/json' \
# Specifies the access token
    -H 'Authorization: Bearer '$MY_TOKEN'' \
# Specifies the data (JSON object) to be sent in the request body. 
# The name, size, region, and image of the Droplet to be created.
    -d '{"name":"ubuntu-cli",
        "size":"s-1vcpu-1gb",
        "region":"nyc3",
        "image":"ubuntu-20-04-x64"}' \
# Specifies the API's URL and prints the response in a human-readable format (JSON).
    "https://api.digitalocean.com/v2/droplets" | python -m json.tool
```

Related:[How Do You Install Python 3.6?](https://adamtheautomator.com/install-python-36/)

Wait for a few minutes until the droplet is created.

![Creating a DOCN Droplet via the CLI](https://adamtheautomator.com/wp-content/uploads/2023/01/image-97.png)

Creating a DOCN Droplet via the CLI

9\. Lastly, run the below command to send an HTTP `GET` request to the DOCN API and retrieve the newly created Droplet’s information.

```bash
curl -X GET -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer '$MY_TOKEN'' \
  "https://api.digitalocean.com/v2/droplets" | jq '.droplets[] | select(.name == "ubuntu-cli")'
```

If successful, you will receive a response, as shown below.

![Retrieving the Droplet's information](https://adamtheautomator.com/wp-content/uploads/2023/01/image-98.png)

Retrieving the Droplet’s information

## Testing Your DigitalOcean VPS

Regardless of which method (Cloud Control Panel or API) you used to create your VPS, you still have to test whether your VPS is working or not. How? You will use the console feature to connect to the Droplet.

Navigate to your Cloud Console, click on the **More** button, and select **Access Console** to get the option to access a console or terminal interface for your Droplet.

![Navigate to the Droplet Console page](https://adamtheautomator.com/wp-content/uploads/2023/01/image-99.png)

Navigate to the Droplet Console page

Next, click **Launch Droplet Console**, which opens your Droplet’s console window (step three) for your Drop.

![Launching the Droplet Console](https://adamtheautomator.com/wp-content/uploads/2023/01/image-100.png)

Launching the Droplet Console

You can now run commands directly from the console and perform various tasks for your Droplet, such as installing software.

![Viewing the Droplet Console](https://adamtheautomator.com/wp-content/uploads/2023/01/image-101.png)

Viewing the Droplet Console

## Managing Your DigitalOcean VPS

With your Droplet working correctly, you can manage it via GUI web-based interface. DigitalOcean lets you create snapshots, turn your Droplet off and on, destroy it, and so on.

1\. On your project’s **Resources** tab, click your Droplet’s name to manage to access its detail page.

![Accessing a Droplet’s detail page](https://adamtheautomator.com/wp-content/uploads/2023/01/image-102.png)

Accessing a Droplet’s detail page

2\. Next, click the toggle button, as shown below, to turn your Droplet **ON** or **OFF**. This feature comes in handy when you plan to disable your Droplet temporarily.

![Turning the Droplet on or off](https://adamtheautomator.com/wp-content/uploads/2023/01/image-103.png)

Turning the Droplet on or off

3\. Now, navigate to **Destroy** (left panel) and click **Destroy this Droplet** to delete the selected Droplet. Deleting Droplets lets you keep your resources clean and eliminate unnecessary charges.

![Deleting a Droplet](https://adamtheautomator.com/wp-content/uploads/2023/01/image-104.png)

Deleting a Droplet

4\. Lastly, provide the Droplet’s name, and click **Destroy** to confirm deleting the Droplet.

Droplet deletion is irreversible, so make sure you have data backups before deleting a Droplet.

![Confirming the Droplet deletion](https://adamtheautomator.com/wp-content/uploads/2023/01/image-105.png)

Confirming the Droplet deletion

## Conclusion

DigitalOcean offers a low-cost and easy way to create VPSs. And in this tutorial, you have learned to create and manage a VPS in DigitalOcean using the API and the GUI interface. By now, you can already confidently test and manage your Droplets.

At this point, your Droplets will be holding data, which is crucial for any business’ success. Why not [create a backup](https://docs.digitalocean.com/products/images/backups/) to protect your data?

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fvps-digitalocean%2F&text=Learn%20How%20to%20Create%20%26%20Manage%20VPS%20DigitalOcean%20VMs)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fvps-digitalocean%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fvps-digitalocean%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2023/06/digitalocean-spaces.jpg)

### [Getting Started with DigitalOcean Spaces](/digitalocean-spaces/)

Dive into DigitalOcean Spaces as an alternative to Amazon S3 and learn how to store files quickly and easily in this ATA Learning tutorial!

![](https://adamtheautomator.com/wp-content/uploads/publisher/3ec5d9c85b2b8140a365ef14a6b86f61/961d44c379185b8fc0fc222f19db075aa840e3336ede327b42a819523a3bdc25.webp)

### [Resolve Kubernetes CoreDNS Timeouts Like a Pro](/fix-coredns-timeouts-kubernetes/)

Trace CoreDNS timeouts through all five Kubernetes DNS hops: ndots:5 lookups, the 5-second conntrack race, cache sizing, and NodeLocal DNSCache.

![](https://adamtheautomator.com/wp-content/uploads/publisher/3f25d9c85b2b81d1ab64dfa279a5857d/85b63aa642603bdd12b4fca256ee8c837736b9fabea4ca8078d1ba31916f346f.webp)

### [Automate GitHub Issue Sync with Notion Workers](/notion-workers-github-issue-sync/)

Give a Notion Worker your GitHub issues endpoint and sync them into a Notion database with a stable key, API pagination, and replace-mode cleanup.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
