← All posts

9 min read

Deploy Django App: Complete Guide for Solo Devs

Key takeaways

  • The fastest way to deploy a Django app is a push-to-deploy PaaS; the cheapest at scale is Docker, Gunicorn, and Nginx on a $5 Linux VPS.
  • Django production non-negotiables are DEBUG off, ALLOWED_HOSTS set, secrets in environment variables, and static files collected.
  • Run migrations from inside the container at runtime, never at build time, so rebuilds never touch your database volume.
  • Free tiers usually sleep after inactivity and require a card on file, so treat them as staging environments, not production.
  • Most major PaaS platforms bill in USD with cards many Kenyan and Ugandan banks do not issue, making mobile money support a deciding factor.

The fastest way to deploy a Django app is a PaaS with push-to-deploy; the cheapest at scale is Docker, Gunicorn, and Nginx on a $5 Linux VPS. This guide walks one complete manual deployment with exact config files, then maps every hosting route to your team size, budget, and ops skill.

What is the easiest way to deploy a Django app?

For most solo developers, the easiest route is a push-to-deploy PaaS: connect your repo, press deploy, and the platform handles HTTPS, static files, and restarts. If you want full control and the lowest running cost, the easiest honest answer is Docker on a Linux VPS you manage yourself. Everything else sits between those two.

Three routes, ranked by effort

  1. PaaS (Heroku, Render, Railway, Fly.io, Omeganodes): git push, done. Omeganodes works the same way for Node apps, and the same push-to-deploy flow applies to Django.
  2. Managed buildpacks on a VPS: more setup, no Kubernetes or YAML required.
  3. Manual Docker on Linux: maximum control, maximum responsibility.

What 'easiest' actually costs you

Whichever route you pick, Django itself has non-negotiables: DEBUG off, ALLOWED_HOSTS set, secrets out of the repo, and static files collected, per the official Django deployment checklist. A PaaS automates some of this; a VPS makes you own all of it. The rest of this article walks each route with a full worked example, then maps them to your team size, budget, and payment options.

How do you deploy a Django app with Docker on a Linux server?

Prepare Django settings for production

Read DEBUG, SECRET_KEY, and ALLOWED_HOSTS from environment variables so nothing sensitive lands in your image. Set STATIC_ROOT = BASE_DIR / "staticfiles" so collectstatic has somewhere to write. Install Gunicorn (pip install gunicorn) and add whitenoise if you want static files served without a separate bucket. Pin everything in requirements.txt; the Docker build has no network surprises if your versions are locked.

Write the Dockerfile with Gunicorn

Keep it short:

FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN python manage.py collectstatic --noinput
CMD ["gunicorn", "myproject.wsgi:application", "--bind", "0.0.0.0:8000", "--workers", "3"]

Build and run it with docker build -t myapp . then docker run -p 8000:8000 --env-file .env myapp. Three workers is a reasonable starting point for a 1–2 GB server; each worker is a full Python process, so match the count to your RAM. If you use Postgres, add psycopg2-binary to requirements and pass DATABASE_URL in your env file. The image contains your code and dependencies only; the database lives outside it, which is what makes rebuilds safe.

This separation is the whole reason Docker works for a solo developer. You can rebuild the image ten times a day and your data never moves, because the container is disposable and the database volume is not. It also means a rollback is just running the previous image, not a forensic exercise in what changed on the server. The trade-off is honest: you now own the Dockerfile, the env files, the restart policy, and the server's security updates. That is roughly an hour of setup and then a few minutes per deploy, which is the price of running on a $5 VPS instead of a platform. If you would rather skip the Dockerfile entirely and keep git push as your deploy step, that is exactly what a PaaS like Omeganodes does (https://omeganodes.com/blog/introducing-omeganodes), and the rest of this section shows you what you would be doing by hand.

Nginx as reverse proxy with automatic HTTPS

Gunicorn serves your app but should not face the internet directly. Put Nginx in front on ports 80 and 443, proxying to 127.0.0.1:8000, and let it serve /staticfiles/ directly so Python never touches static requests. For HTTPS, install Certbot (apt install certbot python3-certbot-nginx) and run certbot --nginx -d yourdomain.com; it obtains a Let's Encrypt certificate and renews it automatically. Point your DNS A record at the server's IP first, or the certificate request fails.

Migrations, static files, and first boot

Run migrations from inside the container, not at build time: docker compose run web python manage.py migrate, or docker exec -it <container> python manage.py migrate if you run plain Docker. collectstatic already ran during the build, so Nginx picks the files up from the mounted volume or copied directory. On first boot, create your superuser the same way, then hit your domain in a browser. If you see a 502, check docker logs before anything else; nine times out of ten Gunicorn crashed on a missing env var, and the log names it.

Where can you deploy a Django app for free?

Free tiers and their real limits

Free tiers exist, but they rarely survive a real workload. Most sleep after inactivity, cap hours per month, or run a single dyno that chokes on Gunicorn workers and a Postgres connection pool. Free tiers also usually require a card on file for verification, which is the exact wall readers without USD-billing cards hit first. Treat a free tier as a staging environment, not production. If you outgrow it, running Django behind Nginx on a cheap VPS is the documented fallback; the Gunicorn docs cover the Nginx setup directly.

Paying without an international card

When the free tier runs out, payment becomes the deciding feature. Render, Railway, and Fly.io all bill in USD with cards most Kenyan and Ugandan banks do not issue. Omeganodes accepts MTN Mobile Money and Airtel Money, prices regionally, and gives you git push to deploy with automatic HTTPS, no Kubernetes or YAML. The trade-off: it is EU-hosted only, so if you need East African data residency it falls short. Details are on the Omeganodes IT page.

How do you deploy a Django app on Heroku in 2024+?

Heroku still runs the classic push-to-deploy flow: commit a Procfile with web: gunicorn myapp.wsgi, push to the heroku remote, let the Python buildpack detect your app, and attach a Postgres addon. The free tier is gone, so your side project starts on paid dynos, and Postgres is a separate monthly line item.

The minimal Heroku setup

Three files get you running: a Procfile, a requirements.txt, and an app that reads config from environment variables. Add the Postgres addon, run migrations from a one-off dyno, and Heroku handles HTTPS, routing, and restarts. It remains the shortest path from git push to a live Django app with a custom domain.

Is Heroku still worth it for a side project?

Honest answer: for a solo developer without a USD-billing card, often no. That is the gap we built Omeganodes for: the same push-to-deploy experience on EU servers, automatic HTTPS, no Kubernetes or YAML, and mobile money payments via MTN and Airtel with regional pricing. Where Heroku falls short for you specifically is billing, not the workflow.

How do you deploy a Django app on AWS Elastic Beanstalk?

Beanstalk takes a requirements.txt and a zip of your code, provisions EC2 instances, an ALB, and auto-scaling, then runs your WSGI app. You keep the AWS console for logs and SSH. Configure environment variables in the console, run migrations via a config file, and attach RDS if you need Postgres.

What Beanstalk handles for you

Instance health, rolling deploys, scaling on CPU, and TLS termination at the load balancer, so your app servers never touch certificates. For Nginx-level control you edit config files in .platform/nginx/, per the Nginx documentation on reverse proxying and TLS.

When Beanstalk is overkill

For one solo dev and one app, you pay for EC2 plus a load balancer whether traffic comes or not, and debugging means reading CloudWatch. A plain VPS or a push-to-deploy PaaS is cheaper and simpler. Check the provider's terms first, for example https://omeganodes.com/terms, and note that Beanstalk still bills in USD, which matters if you pay with MTN or Airtel Money.

How do you deploy a Django and React app together?

Pick one of two topologies. Both work; they differ in how much you deploy per release.

Option A: Django serves the React build

Build React (npm run build), copy the build/ or dist/ folder into your Django project, and serve it with WhiteNoise plus a catch-all template view for client-side routes. One container, one deploy, one git push. The catch: every frontend change requires rebuilding the backend image. If you go this route, base your Dockerfile on the official Python image guidelines rather than hand-rolling one.

Option B: separate frontend host

Ship React to a static host and Django as a JSON API. You must set CORS headers (use django-cors-headers) and point your API calls at an absolute URL, because the frontend no longer shares Django's origin. You also need a rewrite rule so unknown paths return index.html, not a 404.

Option A is simpler for a solo dev; Option B is better once you want independent frontend deploys.

Which Django deployment option should you choose for your team?

Match your team size, budget, and ops skill to a route:

OptionTeam sizeMonthly budgetOps skill neededPayment
Manual Linux + DockerSolo, comfortable with servers$5 VPSHighCard or crypto
HerokuSmall teamPaid plansLowUSD card required
AWS Beanstalk2-5 with AWS experienceVariableHighUSD card required
Render / Railway / Fly.ioSolo or smallFree tier, then paidLowUSD card required
OmeganodesSolo or 2-3Regional pricingLow (git push to deploy)MTN or Airtel mobile money

Omeganodes on the same criteria honestly: push-to-deploy from GitHub with automatic HTTPS, no Kubernetes, no YAML, and mobile money billing, which none of the listed competitors offer for East African developers. Where it falls short: it is a young platform with a smaller ecosystem than Heroku or Render, fewer add-ons, and no free tier at the scale of Railway's. If you need managed databases beyond the basics or a large marketplace, a manual Linux deployment or Render may fit better today.

FAQ

Can I deploy a Django app without a credit card, paying with MTN or Airtel Money?

Yes. Omeganodes accepts MTN Mobile Money and Airtel Money with regional pricing, plus git push to deploy and automatic HTTPS. Render, Railway, Fly.io, Heroku, and AWS Beanstalk all bill in USD with cards that many Kenyan and Ugandan banks do not issue, so mobile money support is the deciding factor if you lack one.

How much does it cost to host a Django app per month?

A manual Docker deployment on a $5 VPS is the floor for production. PaaS pricing starts higher once free tiers expire: Heroku requires paid dynos plus a separate Postgres line item, and Beanstalk bills you for EC2 and a load balancer whether traffic arrives or not. Omeganodes prices regionally with mobile money instead of USD cards.

Do I need Docker to deploy Django, or can I use a VPS without it?

Docker is optional. The alternative is installing Python, Gunicorn, and Nginx directly on the server and running migrations by hand. Docker buys you disposable containers and one-command rollbacks: rebuild the image ten times a day while the database volume stays untouched. Without it, rollbacks mean reconstructing what changed on the server.

How do I add a custom domain and HTTPS to my Django app?

Point your DNS A record at the server's IP first, then install Certbot with the Nginx plugin and run certbot against your domain. It obtains a Let's Encrypt certificate and renews it automatically. Nginx proxies to Gunicorn on localhost and serves static files directly, so Python never touches those requests. PaaS platforms handle this for you.

What is the cheapest way to deploy a Django side project?

Free tiers exist but sleep after inactivity, cap monthly hours, and usually demand a card for verification, so treat them as staging only. The cheapest honest production setup is Docker, Gunicorn, and Nginx on a $5 VPS with three Gunicorn workers, which suits a 1-2 GB server. Expect about an hour of setup, then minutes per deploy.

Deploy at the speed of Africa

World-class hosting, open to every developer, wherever you build and however you pay. Start free in a couple of minutes — no credit card, no lock-in.