SECTION 05 / 9

Part 4 — Tutorial: IaaS with DigitalOcean

2 min read
On this page 4 headings

DigitalOcean is an IaaS provider. It gives you the hardware and the operating system on which to host your application.

Key term: Droplet

Section point: A Droplet is DigitalOcean’s term for a virtual machine.

The droplet shown in the lecture (it hosts the verisim web page) had 1 GB memory, 25 GB disk, and ran Ubuntu 18.04. From the dashboard you can monitor bandwidth, CPU usage, disk I/O and so on.

Creating a droplet, step by step

Creating a DigitalOcean Droplet: (1) click Create Droplet, (2) choose a region / data centre such as Bangalore, (3) choose the configuration — OS, CPU and RAM, (4) configure access (SSH authentication), (5) launch — the cloud VM is running.
Creating a DigitalOcean Droplet: (1) click Create Droplet, (2) choose a region / data centre such as Bangalore, (3) choose the configuration — OS, CPU and RAM, (4) configure access (SSH authentication), (5) launch — the cloud VM is running.
Open image ↗
Illustration: Part 4 — Tutorial: IaaS with DigitalOcean
  • Log in / sign up and create (or open) a project, giving it a name, description and purpose. Existing resources can be moved into it if needed.
  • Create a droplet.
  • Choose a region (data centre). The example chooses Bangalore, closest to us.
  • Choose the operating system and version (e.g. Ubuntu).
  • Choose the droplet type / plan.
  • A basic droplet is enough for simple applications such as blogs, discussion forums and small projects.
  • CPU options: regular, or premium Intel/AMD.
  • Shared CPU vs dedicated CPU.
  • Plans range up to very large machines (around 256 GB RAM and multi-terabyte storage in the lecture). The price is calculated per month, starting from about $6/month at the time of the lecture. Extra storage can be added.

The illustration below shows the droplet configuration options.

Shared CPU vs dedicated CPU: with a shared CPU, several VMs take turns on the same processor cores; with a dedicated CPU, cores are reserved for your VM only — more predictable performance at a higher price.
Shared CPU vs dedicated CPU: with a shared CPU, several VMs take turns on the same processor cores; with a dedicated CPU, cores are reserved for your VM only — more predictable performance at a higher price.
Open image ↗
Illustration: Part 4 — Tutorial: IaaS with DigitalOcean
  • Choose the authentication method:
  • SSH key: connect securely from your own terminal; or
  • Password.
  • Optional extras: enable monitoring and backups.
  • Create the droplet, then log in with the credentials you set.

Connecting to the droplet with SSH

Connect to the DigitalOcean Droplet from a terminal using SSH, then log in and deploy the application as on a local system.
Connect to the DigitalOcean Droplet from a terminal using SSH, then log in and deploy the application as on a local system.
Open image ↗
Illustration: Part 4 — Tutorial: IaaS with DigitalOcean

Deploying the application on the droplet

Section point: After logging in to the droplet you deploy just as you would on your local system: check out the code (e.g. from GitHub), set up the web server and database server, and run the application. With IaaS, all of this is your job.

The full IaaS lifecycle on DigitalOcean: create a droplet (choose region, CPU, RAM, storage), configure the server over SSH (OS, application setup, network and security), then monitor CPU, memory, disk and network usage.
The full IaaS lifecycle on DigitalOcean: create a droplet (choose region, CPU, RAM, storage), configure the server over SSH (OS, application setup, network and security), then monitor CPU, memory, disk and network usage.
Open image ↗
Illustration: Part 4 — Tutorial: IaaS with DigitalOcean

The droplet dashboard also shows live resource graphs. This is your first taste of monitoring, covered fully in Part 7.

After deployment, monitor the VM: CPU, memory, disk and network graphs reveal problems such as high CPU usage, which you then inspect, investigate and act on.
After deployment, monitor the VM: CPU, memory, disk and network graphs reveal problems such as high CPU usage, which you then inspect, investigate and act on.
Open image ↗
Illustration: Part 4 — Tutorial: IaaS with DigitalOcean
YOUR STUDY PROGRESS

Finished this section? Save your progress.

Back to top ↑