Overview
There are three ways to run Enferno in production: Docker Compose, a one-command VPS install with Ignite, or a manual setup.Docker Compose
The Compose stack runs the app under uWSGI with PostgreSQL, Redis, Celery and nginx:setup.sh --docker generates DB_PASSWORD and REDIS_PASSWORD, which Compose requires, and sets SESSION_COOKIE_SECURE=true. For an existing installation, keep the passwords its database and Redis already use. nginx listens on port 80 and serves enferno/static/ directly; PostgreSQL and Redis are not published to the host. Put TLS in front of it, or terminate it in nginx.
Ubuntu VPS with Ignite
Ignite installs an Enferno app on a fresh Ubuntu server with Caddy and automatic SSL, Redis, Celery, systemd services and a firewall:Manual Setup
Install
.env, set FLASK_DEBUG=0 and, once HTTPS is in place, SESSION_COOKIE_SECURE=true.
Database
SQLite works with no setup and lives ininstance/enferno.db. For PostgreSQL:
uv run flask create-db again. Enferno uses the psycopg 3 driver, which uv sync already installs.
App Service
/etc/systemd/system/enferno.service:
Celery Service (Optional)
Only needed with--extra full. /etc/systemd/system/enferno-celery.service:
nginx and SSL
Production Checklist
FLASK_DEBUG=0SESSION_COOKIE_SECURE=truebehind HTTPS- Secrets generated by
setup.sh, never committed,.envreadable only by the app user - Migrations applied with
uv run flask db upgradeon every deploy - Database backups scheduled
- Only ports 22, 80 and 443 open
Troubleshooting
- Static files 404: the nginx
aliasmust point atenferno/staticinside the project, and the nginx user needs read access. - App does not start:
sudo journalctl -u enferno -e. A missingSECRET_KEYorSECURITY_PASSWORD_SALTstops startup with a clear error. - Database errors: check
SQLALCHEMY_DATABASE_URIand that the database user owns the database. - Celery idle:
sudo systemctl status redis-server, and checkCELERY_BROKER_URLin.env.