Python FastAPI Tutorial (Part 18): Deploy to a VPS - Security, Nginx, SSL, and Custom Domain

Corey Schafer · Beginner ·🏗️ Systems Design & Architecture ·20h ago
In this video, we'll be learning how to deploy our FastAPI application to a VPS (Virtual Private Server) so that it's live and accessible on the internet. We'll walk through the entire process, starting with a fresh Ubuntu server and hardening it with SSH key authentication, a firewall, and brute force protection. From there, we'll set up Nginx as a reverse proxy, enable HTTPS with a free SSL certificate from Let's Encrypt, point a custom domain to our application, and use systemd to manage the app as a service so it starts on boot and restarts automatically if it crashes. By the end of this video, you'll have a secure, production-ready FastAPI deployment with a real domain name. Let's get started... Timestamps: Skip to 42:11 if your server is already secure Skip to 59:05 for the FastAPI-specific deployment steps The code from this video can be found here: https://github.com/CoreyMSchafer/FastAPI-18-Deployment-VPS Full FastAPI Course: https://www.youtube.com/playlist?list=PL-osiE80TeTsak-c-QsVeg0YYG_0TeyXI Linode (with Referral): https://www.linode.com/lp/refer/?r=d1a8982f8f82bfff0a130cd5061e50ebb9e07ac1 NameCheap (with Referral): https://namecheap.pxf.io/nyBgR WSL (Windows): https://learn.microsoft.com/en-us/windows/wsl/install Git for Windows: https://git-scm.com/install/windows ✅ Support My Channel Through Patreon: https://www.patreon.com/coreyms ✅ Become a Channel Member: https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g/join ✅ One-Time Contribution Through PayPal: https://goo.gl/649HFY ✅ Cryptocurrency Donations: Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3 Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33 Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot ✅ Corey's Public Amazon Wishlist http://a.co/inIyro1 ✅ Equipment I Use and Books I Recommend: https://www.amazon.com/shop/coreyschafer ▶️ You Can Find Me On: My Website - http://coreyms.com/ My Second Channel - https://www.youtube.com/c/coreymschafer Facebook - https:/
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Related AI Lessons

Choosing between Monoliths and Microservices in the Real World
Learn to decide between monoliths and microservices for your project, understanding the trade-offs and real-world implications
Medium · DevOps
Building Document Management Systems for International Legal Workflows
Learn to build document management systems for international legal workflows, leveraging technologies like Algolia for efficient search and information retrieval.
Dev.to · Diogo Heleno
Caching Is Easy. Production Caching Is Not.
Learn why production caching is challenging and how to overcome its complexities for more efficient systems
Dev.to · Gaurav Sharma
We Designed Our System for 99.9% Uptime. Achieved 94%. Here’s the Math We Got Wrong.
Learn how a system designed for 99.9% uptime achieved only 94% and the mathematical mistakes that led to this discrepancy
Medium · Programming
Up next
HashiCorp Terraform Associate (003) Exam Guide
Coursera
Watch →