Skip to main content
Version: 1.6

Application

Core application settings including database, timezone, proxy configuration, and logging.

Application Settings​

VariableDescriptionDefault
APP_KEYApplication encryption key (required)-
APP_URLFull URL where the app is accessiblehttp://localhost:2226
APP_DEBUGEnable debug mode (set to false in production)false
APP_DISPLAY_TIMEZONETimezone for UI, backup filenames, and cronsUTC

Generating the Application Key​

The APP_KEY is required for encryption. Generate one with:

docker run --rm davidcrty/databasement:1 php artisan key:generate --show

Copy the output (e.g., base64:xxxx...) and set it as APP_KEY.

Timezone Configuration​

Set APP_DISPLAY_TIMEZONE to display dates, backup filenames, and schedule times in your local timezone. A cron like 0 2 * * * will then fire at 02:00 in that zone.

APP_DISPLAY_TIMEZONE=Europe/London

See the list of supported timezones.

Data is always stored in UTC internally. If you previously set TZ, it is migrated automatically — no action needed.

Database Configuration​

Databasement needs a database to store its own data (users, servers, backup configurations).

SQLite (Simplest)​

DB_CONNECTION=sqlite
DB_DATABASE=/data/database.sqlite
note

When using SQLite, make sure to mount a volume for /data to persist data.

MySQL / MariaDB​

Create a database and user for Databasement on your MySQL server:

MySQL:

CREATE DATABASE databasement CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'databasement'@'%' IDENTIFIED BY 'your-secure-password';
GRANT ALL PRIVILEGES ON databasement.* TO 'databasement'@'%';
FLUSH PRIVILEGES;
DB_CONNECTION=mysql
DB_HOST=your-mysql-host
DB_PORT=3306
DB_DATABASE=databasement
DB_USERNAME=databasement
DB_PASSWORD=your-secure-password

PostgreSQL​

Create a database and user for Databasement on your PostgreSQL server:

PostgreSQL:

CREATE DATABASE databasement;
CREATE USER databasement WITH ENCRYPTED PASSWORD 'your-secure-password';
GRANT ALL PRIVILEGES ON DATABASE databasement TO databasement;
DB_CONNECTION=pgsql
DB_HOST=your-postgres-host
DB_PORT=5432
DB_DATABASE=databasement
DB_USERNAME=databasement
DB_PASSWORD=your-secure-password

Reverse Proxy / Trusted Proxies​

When running behind a reverse proxy (nginx, Traefik, Kubernetes Ingress), configure trusted proxies so Laravel can correctly determine the client IP and protocol. See the Troubleshooting section if you have issues with proxy configuration.

VariableDescriptionDefault
TRUSTED_PROXIESIP addresses or CIDR ranges of trusted proxies127.0.0.0/8,10.0.0.0/8,100.64.0.0/10,169.254.0.0/16,172.16.0.0/12,192.168.0.0/16

Alternative values:

  • * - Trust all proxies (simplest option for containerized environments)
  • Comma-separated IPs/CIDRs: 10.0.0.1,192.168.1.0/24 - Trust specific proxies only
  • Empty - Trust no proxies
info

Checks the Troubleshooting section for help with proxy configuration.

Logging​

VariableDescriptionDefault
LOG_CHANNELLogging channelstderr
LOG_LEVELMinimum log leveldebug

For production, stderr is recommended as logs will be captured by Docker.

Complete Example​

Here's a complete .env file for a production deployment with MySQL:

# Application
APP_DEBUG=false
APP_URL=https://backup.yourdomain.com
APP_KEY=base64:your-generated-key-here
# APP_DISPLAY_TIMEZONE=UTC # timezone for UI, backup filenames, and schedules

# Database (for Databasement itself)
DB_CONNECTION=mysql
DB_HOST=mysql.yourdomain.com
DB_PORT=3306
DB_DATABASE=databasement
DB_USERNAME=databasement
DB_PASSWORD=secure-password-here

# Logging
LOG_CHANNEL=stderr
LOG_LEVEL=warning

Troubleshooting​

Enable Debug Mode​

Enable debug mode to access detailed diagnostics:

APP_DEBUG=true

Then visit https://your-domain.com/health/debug to view:

  • Current IP address and whether it's from a trusted proxy
  • Request headers (including X-Forwarded-For, X-Forwarded-Proto)
  • Application configuration

Debugging Trusted Proxies​

If your application shows HTTP instead of HTTPS, or shows the wrong client IP:

  1. Enable debug mode (see above)

  2. Visit /health/debug and check:

    • is_trusted_proxy: Should be true
    • secure: Should be true for HTTPS
    • headers: Check x-forwarded-for and x-forwarded-proto
  3. Common issues:

    • is_trusted_proxy: false → The proxy IP is not in your TRUSTED_PROXIES list
    • secure: false with HTTPS → Trusted proxy not configured, so x-forwarded-proto header is ignored
  4. Quick fix: Set TRUSTED_PROXIES=* to trust all proxies

More troubleshooting​

If you encounter issues, see the Docker Compose Troubleshooting section for common problems and solutions.

See also Docker Networking if you're having issues connecting to your database server.

Run Artisan Commands​

php artisan migrate:status # Check database migrations
php artisan config:show database # View database configuration

Reset a User Password​

If you lose access to an account and email delivery is not configured (so the Forgot password? link cannot send a reset email), reset the password directly from the container. Run this from the directory that holds your docker-compose.yml:

docker compose exec app php artisan user:reset-password you@example.com

The command prompts for the new password (hidden input) and validates it against the app's password rules. Omit the email to be prompted for it as well.

Get Help​

  • Check the logs: docker compose logs app
  • Report issues on GitHub