The initial setup

Digital Ocean has a pretty nice API which makes it easy to automate the creation of their servers (which they call Droplets. This is nice when you’re trying to work towards automation of the entire process (like I was).

I won’t jump into the automation piece just yet, but once you have your DO account setup (sign up here if you don’t have one), it’s a simple interface to Setup Your Droplet.

I chose the Ubuntu 18.04 LTS image with a \$5 server (1GB Ram, 1CPU, 25GB SSD Space, 1000GB Transfer) hosted in their San Francisco data center (SFO21).

We’ve got a server … now what?

We’re going to want to update, upgrade, and install all of the (non-Python) packages for the server. For my case, that meant running the following:

apt-get update
apt-get upgrade
apt-get install python3 python3-pip python3-venv tree postgresql postgresql-contrib nginx

That’s it! We’ve now got a server that is ready to be setup for our Django Project.

In the next post, I’ll walk through how to get your Domain Name to point to the Digital Ocean Server.

  1. SFO2 is disabled for new customers and you will now need to use SFO3 unless you already have resources on SFO2, but if you’re following along you probably don’t. What’s the difference between the two? Nothing 😁

This post is part 2 of the "Deploying your Django App to Digital Ocean" series:

  1. Deploying a Django Site to Digital Ocean - A Series
  2. Setting up the Server (on Digital Ocean)
  3. Getting your Domain to point to Digital Ocean Your Server
  4. Preparing the code for deployment to Digital Ocean
  5. Automating the deployment
  6. Using PostgreSQL
  7. Setting up multiple Django Sites on a Digital Ocean server
  8. Enhancements: Using GitHub Actions to Deploy