3v-Hosting Blog
Quick deployment of a Django project on a VPS server with a pre-installed stack
7 min read
Let’s be honest - deploying a Django project to a VPS can be an annoying chore. You rent a server, SSH into it, install packages, configure Nginx, set up Gunicorn, create PostgreSQL users, write systemd services, tinker with file permissions, and by the end of it, you’ve spent half the day on something that has nothing to do with actual development.
But what if I told you there's a new kind of hosting setup - a “Django VPS” - where all of this is already done for you? Where you just log in, run a script, and your app is live in 3–5 minutes?
I’ve been testing this approach lately and I want to walk you through it. Think of this article as a field report from a developer who’s been burned too many times by vanilla VPS setups and has finally found something that “just works.”
So, What the Heck is a Django VPS?
A Django VPS is a virtual private server that comes with everything you need to host a Django project - already installed, configured, and connected.
No more starting from scratch.
Instead of spending hours installing packages, setting up Nginx, configuring PostgreSQL, and getting Gunicorn to behave, you get a production-ready setup with:
- Ubuntu 22.04
- Python 3.10 with venv support
- PostgreSQL
- Nginx reverse proxy
- Gunicorn app server
- Preconfigured systemd services
- Firewall, HTTPS, and deployment scripts
It’s like someone took the best DevOps practices, packed them into a VPS image, and added a red carpet for your Git repo. You just walk in.
First Login: A Clean Slate and a README
Once you get access to your Django VPS, the experience feels pretty curated.
You SSH into the server as a non-root user, and right away you see a README. Not the vague kind that says “install your app here,” but one with actual instructions - what to run, where your project goes, how to manage services.
Two scripts are waiting for you:
deploy.sh: Gets your app up and running.
reset.sh: Wipes everything if you want to start over.
The PostgreSQL service is running. Nginx is waiting. Gunicorn is ready to serve. All you need is a Git URL.
Run deploy.sh: your project online in minutes
The beauty of this template is in the deployment process. The deploy.sh script does most of the routine boring work, and it does it quickly.
Here's how it works:
1. After running the script, it will ask you for your project's Git URL. The script clones your project to /srv/yourproject/.
2. It will then ask you to enter your database credentials. The script will ask you for the database name, username, and password, after which it will:
- Create a PostgreSQL database and user.
- Grant the necessary permissions.
- Inserts these credentials into your .env or directly into settings.py, depending on your project structure.
3. Once it has the necessary data, the server will configure the environment.
It creates a .env file with all the variables that Django typically needs:
SECRET_KEY
DEBUG=False
DB_NAME, DB_USER, DB_PASSWORD
Configure the systemd service:
The service template file is populated by your project and bound to Gunicorn via a UNIX socket. It is enabled and starts immediately.
Configure Nginx:
Nginx receives a new site configuration that:
- Points to the Gunicorn socket
- Serves static files
- Can automatically configure HTTPS using Certbot (optional, but very convenient)
After that, everything is ready. You just need to install your project's dependencies and migrate the database. Run the commands below or the commands needed to fine-tune your project:
source venv/bin/activate
pip install -r requirements.txt
python manage.py migrate
python manage.py collectstatic
Congratulations! Your site is up and running!
More Python related articles in our Blog:
- How To Find the Length of a List in Python
- Installing and Using Virtualenv with Python3
- Pip: Python Package Management Basics
Need to start over? reset.sh is at your service
Made a mistake? Want to test another project? No problem. Run reset.sh, and it will:
- Stop and disable the Gunicorn service.
- Delete your project folder.
- Delete the user and PostgreSQL database.
- Clear the Nginx configuration.
In 10 seconds, the server will be as fresh and clean as when you first received it.
This is especially useful for testing or if you represent an agency working on multiple Django projects for your clients.
How is this different from a regular VPS?
A regular VPS is a blank canvas. And that sounds great until you realize that you're expected to paint the Sistine Chapel on it... with a toothpick.
Django VPS, on the other hand, is like a canvas that already has a sketch and primer on it. All you have to do is fill it with colors.
It is designed specifically for Django, without unnecessary baggage such as PHP stack, WordPress tools, and the like. It is intended for Python developers who want to quickly deploy their project to production.
Built-in security and best practices
Among other things, our template takes into account the security and reliability of your server:
- SSH root login is disabled.
- UFW is enabled, only ports 22, 80, and 443 are allowed.
- PostgreSQL is bound to localhost.
- Gunicorn uses UNIX sockets to proxy Nginx.
- HTTPS is not mandatory, but is supported out of the box.
- Services are managed through systemd, not through screen or nohup hacks.
This gives you confidence that your project is not just working — it is working securely.
Who is it for?
If you are an individual developer launching an MVP, a freelancer working on a Django client site, a small team deploying test or production applications, or even a teacher showing students how to launch a project, this template will save you time, nerves, and late-night troubleshooting.
Of course, this template is no substitute for enterprise-level infrastructure, but it's perfect for small and medium-sized projects.
Final thoughts
After using a VPS like this for Django, going back to a blank server will feel like a cold shower. It's not just about saving time — it's about peace of mind, knowing that all the template tasks are taken care of and you can focus on your application.
No CI/CD pipelines, no cloud dashboards — just a VPS, your repository, and a script that speaks your language.
You push your code. It runs in real time. End of story.