How to setup a Linux machine with Docker on DigitalOcean for $5

I originally wrote this as a single post to demonstrate how I deployed an ASP.NET Core side project onto a Linux machine using Docker. It soon became a very large post as I covered installing Nginx as well as configuring SSL. So, to get things started, this will be one of the first posts on how to create a Linux machine with Docker.

Cheap hosting for ASP.NET Core

I wanted to find a cheap method of hosting for ASP.NET Core and thus discovered DigitalOcean offered a package for just $5. Yes. Just $5. No, its not slow at all. Its pretty quick.

How to create a Docker droplet

Sign up to DigitalOcean if you haven't got one already. If you can use this referral to get you some free credits to get you started.

Create an account with DigitalOcean

Go ahead and create one - heres are referal to get you started if you don't have an account already

Create a Docker Droplet

  1. Choose a droplet type and size.
    In the one-click apps that DigitalOcean provides, select the docker image as shown below. Be sure to select the size of the droplet. I selected $5 per month.
    web-digitalocean-select-droplet-1
  2. Select backups and region.
    Decide whether you wish to have backups and the region of where the droplet is located. I selected no backups and the London region.
    digitalocean-select-droplet-2
  3. Add ssh capabilities and provide a hostname. I already had a previous ssh key generated, but if this is the first time, be sure to check out this guide on how to connect to your droplet, web-digitalocean-select-droplet-3
  4. When you're happy, click "Create". DigitalOcean will now go ahead and provsion the droplet, which will take only a few minutes.

Connecting to the Droplet

Once the droplet has been created, you can inspect it within the DigitalOcean dashboard and you should see something like this:
web-digitalocean-droplet-created

  1. Obtain the ip address as highlighted in yellow above. I have masked the last few digits for privacy reasons.
  2. SSH into the droplet using the public ip address to ensure that you can connect succesfully. DigitalOcean provides a very useful guide on how to connect to a droplet with ssh.
  3. If all goes well, you should see something like this:
    web-digitalocean-droplet-ssh-4

Great, now that we have access to Linux machine with Docker installed, in the next post, I how I deployed a simple ASP.NET Core project using Docker onto this DigitalOcean droplet.

Newsletter

Receive new content like this and more. No spam. Ever. Unsubscribe whenever you want.

or subscribe via RSS with Feedly!