Deploy Django with SSL and Nginx on Google Cloud Platform Using Ubuntu VM
A step-by-step guide to deploying Django with SSL and Nginx on GCP for secure and scalable web applications.
Feb 13, 2020 · 1 min read · Som

Getting Django to production means putting a proper web server and TLS in front of it. This guide walks through a Gunicorn + Nginx + Let's Encrypt setup on a GCP Ubuntu VM.
The stack
- Gunicorn runs the Django WSGI app.
- Nginx terminates TLS and serves static files / proxies to Gunicorn.
- Certbot (Let's Encrypt) issues and renews the SSL certificate.
The flow
- Provision an Ubuntu VM and open ports 80/443 in the firewall.
- Install dependencies and run Django under Gunicorn (via systemd).
- Configure Nginx as a reverse proxy to the Gunicorn socket.
- Run Certbot to enable HTTPS and auto-renewal.
Takeaway
Separate concerns: Gunicorn serves the app, Nginx handles TLS and static assets, and Certbot keeps certificates fresh — a pattern that scales well beyond one VM.