Skip to main content

Deployment intro

So our application works locally! It’s time to shove it into the cloud. Traditionally, this has kind of sucked, because it’s a pain to make sure your environment has all the right things running in the right way. With Docker and Docker Compose, we’ve managed to write down a lot of the details about how to run our software into a configuration file.

In a complex production web application with lots of moving parts, there’s a good chance you won’t be able to get everything running on a single web server machine. There’s a lot of cloud infrastructure out there that will help you orchestrate multiple containers in a connected cluster; Amazon ECS (Elastic Container Service) is a popular choice. ECS supports Docker images directly, though Docker Compose configurations need to be translated to an ECS-specific cluster specification.

Here, I’m assuming your application is not complex. You’re an HCI researcher building a toy prototype and just trying to get the damn thing running on some web server. You can comfortably run all of your containers on one machine and don’t need any fancy orchestration capabilities. Your services probably won’t crash or get overloaded, and it’d be nice if they automatically restart if they do crash, but you don’t need an entire ecosystem of monitoring infrastructure.

If this isn’t your situation, now’s the time to stop reading. I’m going to walk through pretty much the bare minimum here to get your code running on a web server, though we’ll throw in a reverse proxy after we get the basics working so you can host distinct applications on one domain name and get automatic HTTPS for your web applications.

Step one is to get your hands on a barebones web server running Linux that gives you root shell access. It should be connected to the Internet, preferably with a static, public-facing IP address (which probably rules out a computer sitting in your basement).

I tend to use Linode for this, but the company was acquired recently and I’m a little shaky on its future. Let’s use Amazon Lightsail, which is a quick way to get access to a (virtual) server like the one I describe. You can skip the next section if you already have a server you want to use (even if it already has something else running on it and has some spare capacity, though you’ll want to have a reverse proxy set up to run multiple web applications on the same instance).