🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-build-a-django-and-gunicorn-application-with-docker
How to Build a Django and Gunicorn Application with Docker | DigitalOcean
October 26, 2019 - In this series, you will build and containerize a Django application. The series is designed to introduce you to the fundamentals of migrating an application to Kubernetes, including modernizing your app using the 12FA methodology, containerizing it, and deploying it to Kubernetes.
🌐
TestDriven.io
testdriven.io › blog › deploying-django-to-digitalocean-with-docker-and-github-actions
Continuously Deploying Django to DigitalOcean with Docker and GitHub Actions | TestDriven.io
June 27, 2021 - Curious about how this project was developed? Check out the Dockerizing Django with Postgres, Gunicorn, and Nginx blog post. ... $ git clone https://github.com/testdrivenio/django-github-digitalocean.git --branch base --single-branch $ cd django-github-digitalocean
Discussions

Hosting Django application on DigitalOcean
Here's a DigitalOcean doc to help you: Deploy Django on Ubuntu 22 . I would tell you to keep docker out of this if you don't understand what you're doing yet. A piece of advice, that applies to programming on a bunch of different levels: Don't keep opening up new construction sites when you haven't closed the current ones. Build something, get it working, then decide if you want to add complexity to get some extra features or functionality. You'll have an easier time solving your problems if you're not having to figure out which construction site is causing them. Good luck! More on reddit.com
🌐 r/django
18
8
September 8, 2023
postgresql - Hosting Django Docker Postgres on DigitalOcean Droplets - Stack Overflow
I am new to deploying to DigitalOcean. I recently created a Droplet, into which I will put my Django API to serve my project. I saw that the droplet I rent has 25 GB of memory, and for the actual s... More on stackoverflow.com
🌐 stackoverflow.com
how to dockerize django application and deploy it on ubuntu 18.04
I hope This link will help you. ...rize-your-django-application ... Once you have the image ready on your Docker hub you can run the container as normal. Hope that this helps! ... Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation. ... Full documentation for every DigitalOcean ... More on digitalocean.com
🌐 digitalocean.com
2
July 21, 2019
deploy a docker image in general and with django
I struggle to grasp how to expose a docker image that exists in DO droplet or a registry. Precisely, I’m looking at how to connect the doecker-compose image… More on digitalocean.com
🌐 digitalocean.com
1
April 27, 2023
🌐
DigitalOcean
digitalocean.com › community › questions › deploy-django-with-docker-and-postgresql
Deploy Django with Docker and PostgreSQL | DigitalOcean
March 31, 2023 - . # Run Django migrations to create the necessary tables in the database RUN python manage.py migrate # Expose the default Django port EXPOSE 8000 # Start the Django development server CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] In this Dockerfile, we start by using an official Python 3.9 slim image as the parent image.
🌐
TestDriven.io
testdriven.io › blog › deploying-django-to-digitalocean-with-docker-and-gitlab
Continuously Deploying Django to DigitalOcean with Docker and GitLab | TestDriven.io
May 14, 2024 - First, you'll need to sign up for a DigitalOcean account (if you don't already have one), and then generate an access token so you can access the DigitalOcean API. ... $ curl -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer '$DIGITAL_OCEAN_ACCESS_TOKEN'' \ -d '{"name":"django-docker","region":"sfo3","size":"s-2vcpu-4gb","image":"docker-20-04"}' \ "https://api.digitalocean.com/v2/droplets"
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-scale-and-secure-a-django-application-with-docker-nginx-and-let-s-encrypt
How To Scale and Secure a Django Application with Docker, Nginx, and Let's Encrypt | DigitalOcean
July 10, 2020 - This will provide you with a shell prompt inside of the running container which you can use to create the Django user: ... Enter a username, email address, and password for your user, and after creating the user, hit CTRL+D to quit the container and kill it. Finally, we’ll generate the static files for the app and upload them to the DigitalOcean Space using collectstatic. Note that this may take a bit of time to complete. docker run --env-file env polls sh -c "python manage.py collectstatic --noinput"
🌐
GitHub
github.com › testdrivenio › django-github-digitalocean
GitHub - testdrivenio/django-github-digitalocean: Continuously Deploying Django to DigitalOcean with Docker and GitHub Actions
Configure GitHub Actions to continuously deploy a Django and Docker application to DigitalOcean.
Starred by 54 users
Forked by 43 users
Languages   Python 81.0% | Dockerfile 11.6% | Shell 7.4% | Python 81.0% | Dockerfile 11.6% | Shell 7.4%
🌐
Reddit
reddit.com › r/django › hosting django application on digitalocean
r/django on Reddit: Hosting Django application on DigitalOcean
September 8, 2023 -

Hello there. I have a small django project that I want to deploy to DigitalOcean droplet and connect a domain to it. So far I've decided to use Docker to containerize my application. I now have two containers (one for django and another for postgresql). I've seen an option on DIgitalOcean website to deploy from container images, but I already have my regular Ubuntu droplet with postgresql and docker installed. Now I am confused about what to do next to finally deploy and run my application. I already tried running my containers locally and it works perfectly, but can I somehow deploy the docker images directly to my droplet, or is it only for App Platform? I figured I could somehow pull the project from GitHub and manually add my .env and docker related files, but I am concerned about how secure this approach is. Can someone explain the proper way and also what to do with secrets like database and smpt credentials? I am confused about everything server-related from the beginning, so please let me know if there is any better approach.

🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-deploy-a-scalable-and-secure-django-application-with-kubernetes
How To Deploy a Scalable and Secure Django Application with Kubernetes | DigitalOcean
October 9, 2020 - To roll your app out on Kubernetes, ... and then deploy it to your cluster. You can use a private Docker registry, like DigitalOcean Container Registry, currently free in Early Access, or a public Docker registry like Docker Hub....
Find elsewhere
🌐
DEV Community
dev.to › thierry-django › how-to-deploy-a-django-app-on-digitaloceans-app-platform-with-docker-3b6i
Deploy Your Django App in Production — A Step-by-Step Guide with Docker & PostgreSQL - DEV Community
July 14, 2025 - Go to https://cloud.digitalocean.com/projects and create an account if you don't already have one. Click on "Create", then "App Platform". Choose “GitHub Repository” as the deployment source. Connect your GitHub account and select your repository + branch. Check Autodeploy to redeploy the app automatically when you push. Click Next. ... You’ll see two detected components: one for Python, one for Docker.
Top answer
1 of 1
2

Very good question!

So your approach is perfectly fine, even though I wouldn't use docker compose for your production environment. The reason being that you will definitely need to rebuild and redeploy your application container multiple times and it's better to decouple it from your database container.

In order to do that, just run something similar to this in your server:

docker run -d \
    --name my_db \
    -p 5432:5432 \
    -e POSTGRES_PASSWORD='mypassword' \
    -e POSTGRES_USER="postgres" \
    -v /var/run/postgresql:/var/run/postgresql \
    --network=mynetwork \ 
    --restart=always \
    postgres

Make sure to define a custom network and to register in it your db container as well as your web container and any other standalone service that you need (for example Redis or Celery)

The advantage of the Digital Ocean databases is that they are fully managed. Meaning that you can use their infrastructure to handle backups, and that it would run on a separate server that you can scale up and down based on need.

If I were you I would start with a PostgreSQL container in your server, making sure to define a volume so that even if your server instance crashes the data will be stored on file and will be there waiting for you when you restart the server and db.

Then as your needs evolve you can migrate your data on a more reliable and flexible system. This can be a Digital Ocean database or AWS RDS or a number of others. DB migrations can be a bit scary but nowadays there are plenty of tools to help you with those too.

🌐
DEV Community
dev.to › endalk200 › production-ready-docker-configuration-with-digitalocean-container-registry-part-i-2bjh
Production-Ready Docker Configuration With DigitalOcean Container Registry Part I - DEV Community
January 16, 2022 - Part I of this article series will be setting up a basic Django web app with development level docker configuration using docker-compose and production level docker configuration. We will also discuss in detail the rationale behind our docker configuration. Part II we will be building our docker image, push it to DigitalOcean container registry, and setup CI/CD pipeline with GitHub actions.
🌐
Medium
gerrysabar.medium.com › deploying-django-app-with-docker-postgresql-to-digital-ocean-3b4238c2eafe
Deploying Django App With Docker & PostgreSQL To Digital Ocean | by Gerry Sabar | Medium
January 8, 2022 - You can access localhost:5000 in your own web browser then you can see your django app working as usual. Alright, great, now we’re going to deploy to Digital Ocean server. Please do ssh to your Digital Ocean instance, for example my ssh to my own Digital Ocean is as follow: ... After you do ssh login you can try to clone repository from my repository here for already made code or you can try building repo on your own. Then you go to docker-python directory after finishing the clone (if you’re using my repository with default folder name) and execute this command:
🌐
DigitalOcean
digitalocean.com › community › questions › how-to-dockerize-django-application-and-deploy-it-on-ubuntu-18-04
how to dockerize django application and deploy it on ubuntu 18.04 | DigitalOcean
July 21, 2019 - I hope This link will help you. https://runnable.com/docker/python/dockerize-your-django-application ... Once you have the image ready on your Docker hub you can run the container as normal. Hope that this helps! ... Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation. ... Full documentation for every DigitalOcean product.
🌐
DigitalOcean
digitalocean.com › community › tutorial-series › from-containers-to-kubernetes-with-django
From Containers to Kubernetes with Django
October 8, 2020 - In this series, you will build and containerize a Django application. The series is designed to introduce you to the fundamentals of migrating an application to Kubernetes, including modernizing your app using the 12FA methodology, containerizing ...
🌐
Medium
yonghoabdurahim.medium.com › deploy-a-containerized-django-web-based-real-estate-app-to-digital-ocean-kubernetes-cluster-1bf4201c34a2
Deploy a containerized Django Web Based Real Estate App to Digital Ocean Kubernetes Cluster. | by Abdurahim Yongho | Medium
June 25, 2023 - Dockerhub account. DigitalOcean account · In this project, we will be using terraform to spin up an Ubuntu OS in DigitalOcean. Create a local directory, call django-web-deploy · $ mkdir django-web-deploy · Navigate to the newly created directory and create some terraform configuration files.
🌐
DigitalOcean
digitalocean.com › community › questions › deploy-a-docker-image-in-general-and-with-django
deploy a docker image in general and with django | DigitalOcean
April 27, 2023 - First, update your docker-compose.yml file to include the ports section. For example, if your Django application is running on port 8000 inside the container, you can map it to port 8000 on the Droplet:
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu
Set Up Django with Postgres, Nginx, and Gunicorn on Ubuntu | DigitalOcean
October 3, 2025 - In this comprehensive tutorial, you’ve successfully set up a production-ready Django application with PostgreSQL, Nginx, and Gunicorn on Ubuntu. You’ve learned how to: Configure a robust database setup with PostgreSQL for production environments · Implement advanced performance optimizations for Gunicorn and Nginx · Integrate AI capabilities and modern deployment strategies using Docker
🌐
DEV Community
dev.to › briancaffey › deploying-django-applications-with-docker-swarm-on-digitalocean-using-gitlab-ci-traefik-nginx-and-rex-ray-5g3b
Deploying Django applications with docker swarm on DigitalOcean using GitLab CI, Traefik, NGINX and REX-Ray - DEV Community
August 10, 2020 - This is a great primer for a lot of what I'll be talking about and it includes some great visualizations. mattsegal.dev has lots of good content related to Django, I also recommend checking out this article about how NGINX is used with Django. Thanks for the great resources, Matt! Sign up for a new DigitalOcean account if you don't already have one · Create a DigitalOcean project https://cloud.digitalocean.com/projects/new · Create a personal access token (we will use this to configure a docker addon that will provision block storage volumes automatically) https://cloud.digitalocean.com/account/api/tokens