Deployment with Debian Packages
This method installs HCW@Home directly on a Debian/Ubuntu server via .deb packages. Services are managed by systemd. This is the recommended approach for production deployments on dedicated infrastructure.
Prerequisites
- Debian 13 (Trixie) or compatible
- PostgreSQL 15+
- Redis 7+
- Nginx
- Minimum 2 GB RAM
Available Packages
The solution is distributed as three independent packages:
| Package | Content |
|---|---|
hcw-backend |
Django API, administration, Celery worker, scheduler |
hcw-practitioner |
Practitioner web interface (Angular) |
hcw-patient |
Patient web/mobile interface (Ionic) |
Installation
1. Install system dependencies
2. Create the database
3. Install HCW packages
The installation automatically creates:
- A
hcwsystem user - The
/var/lib/hcw/directory for uploads - The systemd services
4. Configure the backend
Edit the configuration file:
Security
Generate an encryption key with: echo -n "your secret phrase" | sha256sum
For the full list of variables, see the Docker Compose page.
5. Create a tenant
HCW@Home uses multi-tenancy with PostgreSQL schema isolation. Each tenant has its own data, users, and configuration. Tenants are created via the Django shell.
- schema name: localhost
- name: localhost
- domain: 127.0.0.1
Nginx Configuration
The hcw-backend package provides a reference Nginx configuration file. Copy and adapt it:
cp /usr/share/hcw/nginx /etc/nginx/sites-available/hcw
ln -s /etc/nginx/sites-available/hcw /etc/nginx/sites-enabled/
rm /etc/nginx/sites-enabled/default
nginx -t && systemctl reload nginx
The default configuration defines two server blocks:
HTTPS
In production, add a TLS certificate. With Let's Encrypt: certbot --nginx -d your-domain.com -d patient.your-domain.com
Upgrading
Migrations are automatically applied on hcw service restart.
Load Test Data (optional)
Test1234