This guide provides instructions for deploying Compass on a Contabo server using Docker.
- Contabo VPS with Ubuntu/Debian
- Docker and Docker Compose installed
- Domain configured with DNS pointing to your server
- SSH access to the server
- Update system packages:
sudo apt update && sudo apt upgrade -y- Install Docker:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh- Install Docker Compose:
sudo apt install docker-compose -y- Clone the repository:
git clone https://github.com/Merge-Labs/Compass.git
cd Compass/nisria-backend- Configure environment variables:
cp env.prod.example .env.prod
nano .env.prod # Edit with your production settingsKey variables to configure in .env.prod:
SECRET_KEY: Generate a secure Django secret keyDATABASE_NAME,DATABASE_USER,DATABASE_PASSWORD: Your PostgreSQL credentialsALLOWED_HOSTS: Your domain names (e.g., example.com,api.example.com)DEBUG: Should beFalsein productionGUNICORN_WORKERS: Number of Gunicorn workers (typically 2-4)
- Build and run the containers:
docker-compose -f docker-compose.prod.yml up --build -dAfter deploying for the first time, you need to create a super admin user:
docker-compose -f docker-compose.prod.yml exec web python manage.py createsuperuserYou will be prompted to enter:
- Email address
- Username
- Password
- Password confirmation
This account will have full administrative access to the Compass system.
If needed, run database migrations:
docker-compose -f docker-compose.prod.yml exec web python manage.py migrateTo collect static files for Django admin:
docker-compose -f docker-compose.prod.yml exec web python manage.py collectstatic --noinputSet up SSL certificates using Certbot (replace with your actual domain):
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d example.com -d api.example.comReplace example.com with your actual domain name.
View application logs:
docker-compose -f docker-compose.prod.yml logs -f webView nginx logs:
docker-compose -f docker-compose.prod.yml logs -f nginxTo update to the latest version:
cd Compass
git pull origin main
cd nisria-backend
docker-compose -f docker-compose.prod.yml down
docker-compose -f docker-compose.prod.yml up --build -dCreate a database backup:
# Using variables from your docker-compose.prod.yml configuration
# Replace DB_USER and DB_NAME with values from your .env.prod file
docker-compose -f docker-compose.prod.yml exec -T db pg_dump -U <DB_USER> <DB_NAME> > backup_$(date +%Y%m%d).sqlExample with default values:
docker-compose -f docker-compose.prod.yml exec -T db pg_dump -U manassehgitau main > backup_$(date +%Y%m%d).sqlNote: The -T flag disables pseudo-TTY allocation for proper output redirection. Replace <DB_USER> and <DB_NAME> with your actual database credentials from docker-compose.prod.yml.
docker-compose -f docker-compose.prod.yml logs webCheck if the database container is running:
docker-compose -f docker-compose.prod.yml psEnsure proper permissions on the docker-entrypoint.sh:
chmod +x docker-entrypoint.sh- Docker Documentation
- Django Deployment Checklist
- README-deploy.md - Quick deployment guide