1. Add a new user (see useradd)
  2. Setup a database (see postgresql)
  3. Clone repo
git clone <github_repo_url>
cd django_project_dir
  1. Create a virtual-env and install dependencies within it
python3 -m venv ~/.venv/appname
source ~/.venv/appname/bin/activate
  1. Setup project (django below)
pip install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
python manage.py collectstatic
python manage.py createsuperuser
  1. Create socket/service for app (see systemctl)
  2. Configure nginx server blocks
  3. Get a certbot certificate:
sudo certbot --nginx -d www.example.com

See Also