Create a Digital Ocean Server
Your DjangoMango project is running on your local machine for development. But now it's time to get access to a remote server so that others can see your work in production.
Last updated
Was this helpful?
Your DjangoMango project is running on your local machine for development. But now it's time to get access to a remote server so that others can see your work in production.
Last updated
Was this helpful?
The first step towards setting up your deployment environment will be to provision and access a remote server so you can host and serve your application files. And to do that, you'll want to get yourself a DigitalOcean account.
DigitalOcean refers to their cloud servers as 'droplets'. And this is what you will be installing and running your Django application on. So to get started, access your DigitalOcean dashboard and find the 'Create > Droplet' option. You'll be presented with a set of options, which we will work through step-by-step below.
First, you'll need to pick the image you want to install on your droplet. If you want to take advantage of the Docker configurations we ship with our products, then we recommend you pick DigitalOcean's pre-configured Docker image. Which can be found via their marketplace.
Next, you'll need to select what droplet size you would like. Droplets come in all shapes and sizes, and the one you should go for will ultimately depend on your application type and use-case. A dynamic content application which serves a great deal of traffic will want a well provisioned and dedicated server. While a small app which generally serves static content (such as a blog), will run fine on a shared server with minimal resources.
If you aren't sure, then we recommend DigitalOcean's 'Shared CPU/ Basic' droplet with 1 vCPU and 2GB of memory. That droplet should be more than sufficient for most small to medium sized web applications built on Django. Or, you may even get away with a 1 vCPU / 1 GB droplet if you're simply looking to run a personal blog.
One of the benefits of cloud-based hosting, is that you can provision your resources almost anywhere across the globe. And DigitalOcean is no different.
If you're running a simple application which is light on content and media, then your choice here may not have a significant impact on performance. But either way, try to pick the region closest to your majority user-base and/or your own location.
You have a few additional options for your droplet in the next section. Here, let's enable monitoring so we can take advantage of Digital Ocean's metric collection and monitoring functions. But we can leave IPv6 and User data as disabled.
Next, you need to either create a root password or SSH key to access your droplet. We highly recommend you create a key for the additional security. To do so, you can follow DigitalOcean's instructions on the right of the screen.
You're almost ready to finalize and build your droplet. But you'll first need to decide whether you want to enable backups of your droplet's file system. The choice is yours of course, but in our opinion, you'll only need to enable droplet backups if you don't intend on creating a separate managed database.
Why you may ask? Well, it's important to understand that if you don't run a separate managed database, all of your application data will be created and stored via our pre-configured Docker database image which will actually reside on your droplet disk. So if something happens to your droplet and you don't have a backup, you will also lose all of your application data.
And that's it. You're now ready to create your new droplet via the Create Droplet button at the bottom of the page.
Note that the above droplet is actually built on Ubuntu 20.04, but it'll come installed with Docker 19.03.12 and docker-compose 1.27.0 from the get-go per .
Keep in mind, you do have the option to create a managed , which will allow you to replicate and serve your application files via a global Content Delivery Network (CDN). That way, your users will be able to retrieve your app files, particularly large media files, from a CDN server nearest to their own location rather than your droplet location.
Once set up, you can make use of to access your droplet if you are on Windows, or if you prefer to use terminal via Linux or MacOS.
Alternatively, if you do create a separate , all of your application data will be on a separate dedicated server which will have it's own regular backup. And while your actual Django application files may still be at risk, these should be read-only from the perspective of the droplet. So you should be in a position to quickly and easily get a fresh set of your project files back on the droplet, and get back up and running again.