All chapters

Chapter 12: Example Server Setup

In Chapter 12: Example Server Setup, we walk through creating a fully operational production environment on a single Linux cloud server. You’ll learn how to provision a Hetzner VM, secure it with a firewall, install Docker, and build layered images for both Linux- and Python-based containers. Then, see how to deploy a Flask+HTMX app via Granian, wire it into NGINX, and ensure automatic startups with systemd. Finally, you’ll script deployments and updates, simplifying future releases. By following these step-by-step instructions, you’ll get an end-to-end blueprint for running Python web apps on a fully controlled, one-server infrastructure.

Buy the full book to get this chapter
Next up: Chapter 13: Static Sites and Hugo
Talk Python's Mastodon Michael Kennedy's Mastodon