# EternityMail Docker Compose deployment for Stalwart Mail and Roundcube. ## Requirements - Docker Engine with the Compose plugin - A Linux host for the production deployment - DNS records pointing the mail hostname to the server - The `ep-roundcube-skin` repository available as a sibling directory if the custom skin is enabled ## Configuration Create the real environment file from the template: ```bash cp .env.example .env ``` Edit `.env` and set production values, especially: - `MAIL_HOSTNAME` and `MAIL_DOMAIN` - `RC_DB_PASSWORD` - `RC_DB_ROOT_PASSWORD` - `RC_DES_KEY` - `STALWART_RECOVERY_ADMIN` The real `.env` file is ignored by Git. Do not commit credentials or recovery settings. ## Generate a DES key On Linux or macOS: ```bash chmod +x scripts/generate-des-key.sh scripts/generate-des-key.sh ``` On Windows PowerShell: ```powershell .\scripts\generate-des-key.ps1 ``` Put the generated 24-character value in `RC_DES_KEY` in `.env`. ## Prepare Linux data directories The Stalwart container runs as uid/gid `2000`. Create the bind-mounted directories and set the required ownership before starting the stack: ```bash chmod +x scripts/setup-data-dirs.sh sudo ./scripts/setup-data-dirs.sh ``` The script uses `DATA_ROOT` from `.env` when it is exported in the shell; otherwise it defaults to `/opt/eternitymail`. To use the value from `.env` directly, run the setup command with it loaded or pass the path explicitly: ```bash sudo DATA_ROOT=/opt/eternitymail ./scripts/setup-data-dirs.sh ``` ## Custom Roundcube skin The default configuration expects the skin at: ```text ../ep-roundcube-skin/eternity ``` relative to this repository. Override the location in `.env` with `ROUNDCUBE_SKIN_PATH` if needed. The skin directory is mounted read-only and selected with `ROUNDCUBE_SKIN_NAME`. ## Start and stop Validate the rendered configuration: ```bash docker compose config --quiet ``` Start the services: ```bash docker compose up -d ``` View service status and logs: ```bash docker compose ps docker compose logs -f stalwart ``` Stop the services without deleting persistent data: ```bash docker compose down ``` Persistent data is stored under `DATA_ROOT` in the `stalwart`, `roundcube-db`, and `roundcube-config` directories. ## Network ports The host bindings are configurable in `.env`: - SMTP: `STALWART_SMTP_PORT` (default `25`) - Submission: `STALWART_SUBMISSION_PORT` (default `587`) - IMAPS: `STALWART_IMAPS_PORT` (default `993`) - Stalwart administration: `STALWART_ADMIN_BIND` and `STALWART_ADMIN_PORT` (defaults `127.0.0.1:8081`) - Roundcube: `ROUNDCUBE_BIND` and `ROUNDCUBE_PORT` (defaults `127.0.0.1:8091`) The Stalwart and Roundcube containers communicate over the private `eternitymail` Docker network.