Elena' s AI Blog

From Localhost to Live

26 Sep 2026 (updated: 05 Oct 2026) / 52 minutes to read

Elena Daehnhardt

Matrix fell, Midjourney Nov 2023


If you click an affiliate link and subsequently make a purchase, I will earn a small commission at no additional cost (you pay nothing extra). This is important for promoting tools I like and supporting my blogging.

I thoroughly check the affiliated products' functionality and use them myself to ensure high-quality content for my readers. Thank you very much for motivating me to write.



TL;DR:
  • The example stack (Flask, FastAPI, Celery worker, Redis) is complete in this post, so every step can be reproduced from a blank Ubuntu 22.04 LTS VPS.
  • Publish container ports on `127.0.0.1` only; Docker's own firewall rules bypass `ufw`, so loopback binding is what keeps the containers behind Nginx.
  • Nginx strips the `/api/` prefix and FastAPI is told about it with `root_path`, which avoids the most common reverse-proxy 404.
  • A restart policy reacts to a process exit, a health check only reports health, and `depends_on` with `service_healthy` is what makes Redis ready before the API starts.
  • Let's Encrypt stopped sending expiry emails in June 2025, so test `certbot renew --dry-run` and monitor expiry yourself.
  • Redis persistence is not a backup: take snapshots, copy them off the server, and restore one into a test container before you need it.

Previous: Part 2 β€” Docker Permissions Without Panic: Why I Ran chown Inside My Container

Next: Part 5 β€” Caching Docker Compose Builds with BuildKit

Deploying a Docker Compose stack to a Vultr VPS with Nginx and HTTPS

You have a Flask frontend, a FastAPI backend, a Redis instance and a Celery worker, all wired together with Docker Compose. It works on your laptop. Now it needs to work on the internet, where nobody will forgive a missing environment variable.

Managed services such as Google Cloud Run are simpler. Sometimes you want more control, a predictable base server cost, or you simply enjoy getting your hands dirty with server administration. That is where a Virtual Private Server (VPS) such as Vultr comes in.

A VPS deployment is a single-host production setup where you own the whole stack (operating system, container runtime, reverse proxy and TLS certificates) in exchange for a fixed monthly base price rather than per-request billing. Storage, backups and bandwidth can still add to the bill. The limits are real too: one server means one point of failure, and updates cause a brief outage. I will say where that matters as we go.

This post takes a complete example from a blank Vultr server to HTTPS, with Nginx as the reverse proxy and Certbot with Let’s Encrypt for certificates. I wrote it after deploying another app to Vultr, and the docker group trap in Step 3 comes straight from my own deployment notes.

Prerequisites

  1. A Vultr account: If you do not have one, sign up at Vultr.
  2. A domain name: Registered with a provider such as GoDaddy.
  3. An SSH client: For Windows, PuTTY or Git Bash; for macOS and Linux, your built-in terminal.
  4. Git: Installed on your local machine.
  5. Your project in a Git repository: GitHub or similar, reachable from the server. The example below is small enough to type in yourself.

Throughout, I use one Ubuntu version, 22.04.5 LTS, because it is the one I have actually run this on, so every command in the post matches a single tested environment. Standard support for 22.04 ends in April 2027, so for a brand-new server you may prefer 24.04 LTS. Docker’s installation page lists 24.04 and 26.04 as supported too, and the steps should carry over, but I have not followed this post on them.

The example project: Flask, FastAPI, Redis and Celery

πŸ”’ Subscribe to keep reading.

Deployment walkthrough: from blank VPS to HTTPS

πŸ”’ Subscribe to keep reading.

Verification: what success looks like at each layer

πŸ”’ Subscribe to keep reading.

Operations: logs, resources, backups, updates and troubleshooting

πŸ”’ Subscribe to keep reading.

Production hardening, briefly

πŸ”’ Subscribe to keep reading.

Pre-launch checklist for a Docker Compose VPS

πŸ”’ Subscribe to keep reading.

Final thoughts

πŸ”’ Subscribe to keep reading.

References

πŸ”’ Subscribe to keep reading.

You've hit a Deep Dive tutorial.

I spend dozens of hours researching, coding, and breaking things to write these guides. This content is free, but reserved for my subscriber community. Drop your email below to unlock this guide (and all past/future deep dives):

Already a subscriber? Use the magic link from your last newsletter, or reset your password.

New subscribers get an inbox mail: Set a password to unlock articles. The form does not log you in β€” use the same email afterwards.

desktop bg dark

About Elena

Elena, a PhD in Computer Science, simplifies AI concepts and helps you use machine learning.





Citation
Elena Daehnhardt. (2026) 'From Localhost to Live', daehnhardt.com, 26 September 2026. Available at: https://daehnhardt.com/blog/2026/09/26/deploy-your-docker-compose-app-in-vultr/
All Posts