Skip to main content

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

In .env, set FLASK_DEBUG=0 and, once HTTPS is in place, SESSION_COOKIE_SECURE=true.

Database

SQLite works with no setup and lives in instance/enferno.db. For PostgreSQL:
Then run 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=0
  • SESSION_COOKIE_SECURE=true behind HTTPS
  • Secrets generated by setup.sh, never committed, .env readable only by the app user
  • Migrations applied with uv run flask db upgrade on every deploy
  • Database backups scheduled
  • Only ports 22, 80 and 443 open

Troubleshooting

  • Static files 404: the nginx alias must point at enferno/static inside the project, and the nginx user needs read access.
  • App does not start: sudo journalctl -u enferno -e. A missing SECRET_KEY or SECURITY_PASSWORD_SALT stops startup with a clear error.
  • Database errors: check SQLALCHEMY_DATABASE_URI and that the database user owns the database.
  • Celery idle: sudo systemctl status redis-server, and check CELERY_BROKER_URL in .env.