Skip to main content

Configuration

This page contains all the environment variables you can use to configure Databasement.

Application Settings

VariableDescriptionDefault
APP_DEBUGEnable debug mode (set to false in production)false
APP_URLFull URL where the app is accessiblehttp://localhost:2226
APP_KEYApplication encryption key (required)-

Generating the Application Key

The APP_KEY is required for encryption. Generate one with:

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

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

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

Backup Storage

Configure where backup files are stored temporarily during operations.

VariableDescriptionDefault
BACKUP_WORKING_DIRECTORYLocal temp directory for backups/tmp/backups

S3 Storage

Databasement supports AWS S3 and S3-compatible storage (MinIO, DigitalOcean Spaces, etc.) for backup volumes.

We use ENV variables to configure the S3 client.

S3 IAM Permissions

The AWS credentials need these permissions:

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::your-bucket-name",
"arn:aws:s3:::your-bucket-name/*"
]
}
]
}

Access keys (Optional)

This is not recommended but for standard AWS access using access keys:

AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
AWS_REGION=us-east-1

S3-Compatible Storage (MinIO, etc.)

For S3-compatible storage providers, configure a custom endpoint:

AWS_ENDPOINT_URL_S3=https://minio.yourdomain.com
AWS_USE_PATH_STYLE_ENDPOINT=true

IAM Role Assumption (Restricted Environments)

To force Databasement to assume an IAM role, set the AWS_CUSTOM_ROLE_ARN environment variable:

AWS_CUSTOM_ROLE_ARN=arn:aws:iam::123456789:role/your-role-name

AWS Profile Support

If using AWS credential profiles (from ~/.aws/credentials):

AWS_S3_PROFILE=my-s3-profile

All S3 Environment Variables

VariableDescriptionDefault
AWS_ACCESS_KEY_IDAWS access key (picked up automatically by SDK)-
AWS_SECRET_ACCESS_KEYAWS secret key (picked up automatically by SDK)-
AWS_REGIONAWS regionus-east-1
AWS_ENDPOINT_URL_S3Custom S3 endpoint URL-
AWS_USE_PATH_STYLE_ENDPOINTUse path-style URLs (required for MinIO)false
AWS_S3_PROFILEAWS credential profile for S3-
AWS_CUSTOM_ROLE_ARNIAM custom role ARN to assume-
AWS_ROLE_SESSION_NAMESession name for role assumptiondatabasement
AWS_ENDPOINT_URL_STSCustom STS endpoint URL-
AWS_STS_PROFILEAWS credential profile for STS-

Troubleshooting

Debug the aws configuration by running:

php artisan config:show aws

This is where we create the S3 client: app/Services/Backup/Filesystems/Awss3Filesystem.php

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

# 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 with APP_DEBUG=true in your values file.

    • Go to https://dabasement.yourdomain.com/health/debug to view the debug page.
  • Check the logs

  • Report any issues on GitHub

Run Artisan Commands

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