Prerequisites
- Git
- Docker and Docker Compose
- Python 3.10+
- (Optional) pre-commit for code quality hooks
Clone the Repository
Clone the repository with all submodules:Configure Environment
- Copy the example environment file:
- (Optional) Customize the
.envfile for your local setup. Key variables for development:
Build and Start Services
Build the development images and start all containers:- app: Django application (accessible at
http://localhost:8011directly, orhttps://localhostvia nginx) - nginx: Reverse proxy with SSL
- db: PostgreSQL/PostGIS database
- minio: S3-compatible object storage
- worker_wrapper: Background job processor
- smtp4dev: Email testing tool (web UI at
http://localhost:8012)
Always develop and test through the nginx reverse proxy at
https://localhost rather than using the Django built-in server directly.Initialize the Database
- Run Django database migrations:
- Collect static files (CSS, JS, etc.):
- Create a superuser for accessing the Django admin:
(Optional) Load Sample Data
If you have a database dump for development:Trust the SSL Certificate
QFieldCloud automatically generates a self-signed certificate in./conf/nginx/certs. To avoid SSL errors, trust the root certificate.
On Debian/Ubuntu
Copy and trust the certificate:Remove the Certificate
To remove the trusted certificate:Access the Application
After setup:- Main Application: https://localhost
- Django Admin: https://localhost/admin/
- API: https://localhost/api/v1/
- API Documentation: https://localhost/swagger/
- Django Dev Server (direct): http://localhost:8011
- Email Testing UI: http://localhost:8012
- Minio Console: http://localhost:8010
Verify Installation
Check the health status:"database": "ok" and "storage": "ok".
Database Access
Connect to the PostgreSQL database:Via Docker
Via pg_service.conf
Create~/.pg_service.conf:
Compile Translations
If working on translations:Managing Dependencies
QFieldCloud usespip-compile to manage Python dependencies.
To regenerate all requirements*.txt files:
Troubleshooting
Check Logs
View logs for specific services:Check Service Status
Rebuild Services
If you’ve made changes to Dockerfile or dependencies:Reset the Database
To start fresh:Next Steps
- Architecture Overview - Understand the codebase structure
- Running Tests - Learn about the test suite
- Debugging - Set up your debugger
- Contributing - Read the contribution guidelines