SafariDesk Self-Hosted Architecture
SafariDesk self-hosting runs from the monorepo root using Docker Compose. The default deployment uses one public Nginx entrypoint and keeps the application, database, Redis, WebSocket, and background worker services private inside the Docker network. Related pages:- Installation
- Configuration
- Docker Images and Releases
- Production Deployment
- Update Guide
- Backup and Restore
- Troubleshooting
Deployment Model
The consolidated repository contains both application codebases:frontend/contains the Vite React frontend.backend/contains the Django backend, API, Channels server, Celery app, and migrations.deploy/nginx/contains reverse proxy routing.deploy/scripts/contains maintenance scripts.docs/self-hosting/contains deployment documentation.
docker-compose.yml defines all required services.
Docker Services
SafariDesk uses eight Compose services by default.
Only
nginx publishes a host port by default.
Application images:
- Frontend image:
safaridesk/safaridesk-frontend - Backend image:
safaridesk/safaridesk-backend
- Nginx:
nginx:1.27-alpine - PostgreSQL with pgvector:
pgvector/pgvector:pg16 - Redis:
redis:7-alpine
Architecture Diagram
Public and Private Network Boundaries
Public by default:nginxon${HTTP_PORT:-80}
frontend:80backend:8100channels:8101db:5432redis:6379workerbeat
Routing
The default self-hosted deployment uses same-domain routing.
Same-domain routing is the recommended default because it avoids most CORS, CSRF, WebSocket origin, and upload URL problems.
Storage
SafariDesk uses Docker volumes for persistent and shared data.
The backend media root is configured through:
Database
Thedb service uses:
deploy/scripts/.
Redis, Celery, and WebSockets
Redis is used by:- Celery worker queueing
- Celery result backend
- Django Channels
- Backend cache features where configured
channelsruns Daphne for WebSockets.workerruns Celery workers.beatruns Celery Beat scheduled tasks.
Environment Files
Self-hosting uses one root.env file.
Start from:
- App identity
- Docker image namespace and tag
- Domains and URLs
- Security
- Database
- Redis and Celery
- Email and SMTP
- Admin bootstrap
- OAuth and mail integrations
- Integrations
- AI providers
- Billing and licensing
- Optional ports
Docker Image Strategy
SafariDesk publishes two application images:backendchannelsworkerbeat
SAFARIDESK_IMAGE_TAG to a released version instead of using latest.
See Docker Images and Releases for release and tag details.
Health Checks
Compose health checks are configured for:nginxfrontendbackenddbredis
Licensing
The environment file includes licensing settings:Production Notes
For production deployments:- Use a Linux host.
- Keep only ports
80and443public. - Put TLS in front of Nginx or extend the Nginx deployment to terminate TLS.
- Pin Docker image tags.
- Use strong secrets in
.env. - Back up
postgresdataanduploads. - Run migrations after upgrades.

