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 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.
- 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:
- Deploying a Django Site to Digital Ocean - A Series
- Setting up the Server (on Digital Ocean)
- Getting your Domain to point to Digital Ocean Your Server
- Preparing the code for deployment to Digital Ocean
- Automating the deployment
- Using PostgreSQL
- Setting up multiple Django Sites on a Digital Ocean server
- Enhancements: Using GitHub Actions to Deploy