Skip to Content
Developer GuideEnvironment Configuration

Last Updated: 3/16/2026


Environment Configuration

LinkAce uses environment variables for configuration. All settings are stored in the .env file in the application root.

Configuration Files

  • .env - Your local environment configuration (not tracked in git)
  • .env.example - Template with all available settings
  • .env.dev - Development environment defaults
  • .env.docker.production - Docker production defaults
  • .env.sqlite.production - SQLite production defaults

Core Settings

Application

# Application key (generated during setup) APP_KEY=someRandomStringWith32Characters # Application name APP_NAME=LinkAce # Environment: local, production, staging APP_ENV=production # Enable debug mode (never enable in production!) APP_DEBUG=false # Application URL APP_URL=https://your-linkace-instance.com # Timezone APP_TIMEZONE=UTC # Locale APP_LOCALE=en

Database

# Database driver: mysql, pgsql, sqlsrv, sqlite DB_CONNECTION=mysql # Database host DB_HOST=db # Database port DB_PORT=3306 # Database name DB_DATABASE=linkace # Database username DB_USERNAME=linkace # Database password (use quotes if it contains special characters) DB_PASSWORD="ChangeThisToASecurePassword!"

API Configuration

# API version API_VERSION=2.0 # API rate limit (requests per minute) API_RATE_LIMIT=60

Cache & Session

# Cache driver: file, redis, memcached, database CACHE_DRIVER=file # Session driver: file, cookie, database, redis SESSION_DRIVER=file # Session lifetime (minutes) SESSION_LIFETIME=120

Queue

# Queue driver: sync, database, redis, sqs QUEUE_CONNECTION=sync

Mail

# Mail driver: smtp, sendmail, mailgun, ses, postmark, log MAIL_MAILER=smtp # SMTP settings MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=tls # From address MAIL_FROM_ADDRESS=hello@example.com MAIL_FROM_NAME="${APP_NAME}"

Feature Configuration

# Enable Internet Archive backups ARCHIVE_BACKUPS_ENABLED=true # Enable archiving of private links ARCHIVE_PRIVATE_BACKUPS_ENABLED=false
# Enable automatic link health checks LINK_CHECK_ENABLED=true # Check interval (daily, weekly, monthly) LINK_CHECK_INTERVAL=weekly

User Settings

# Allow user registration REGISTRATION_ENABLED=true # Require email verification EMAIL_VERIFICATION_ENABLED=false # Enable guest access (view public links without login) GUEST_ACCESS_ENABLED=true

SSO Configuration

# Enable Single Sign-On SSO_ENABLED=false # Allow new user registration via SSO SSO_REGISTRATION_ENABLED=true # Disable regular email/password login REGULAR_LOGIN_DISABLED=false

Provider-Specific Settings

Each SSO provider requires its own configuration. Example for GitHub:

GITHUB_CLIENT_ID=your_github_client_id GITHUB_CLIENT_SECRET=your_github_client_secret GITHUB_REDIRECT_URI=https://your-linkace.com/auth/github/callback

See the SSO Configuration Guide for provider-specific setup.

Backup Configuration

# AWS S3 or compatible storage for backups AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_DEFAULT_REGION=us-east-1 AWS_BUCKET= AWS_ENDPOINT= AWS_USE_PATH_STYLE_ENDPOINT=false

Advanced Settings

Logging

# Log channel: stack, single, daily, slack, syslog, errorlog LOG_CHANNEL=stack # Log level: debug, info, notice, warning, error, critical, alert, emergency LOG_LEVEL=debug

Security

# Trusted proxies (comma-separated IPs or "*" for all) TRUSTED_PROXIES= # Force HTTPS FORCE_HTTPS=false

Performance

# Cache duration (seconds) CACHE_DURATION=3600 # Default pagination limit PAGINATION_DEFAULT=25

LinkAce-Specific Configuration

File: config/linkace.php

'default' => [ 'pagination' => 25, 'date_format' => 'Y-m-d', 'time_format' => 'H:i', 'cache_duration' => 3600, // 60 minutes ], 'listitem_count_values' => [ 12, 24, 60, 72, 120, ],

Date & Time Formats

Available date formats:

  • Y-m-d (2024-01-15)
  • d.m.Y (15.01.2024)
  • m/d/Y (01/15/2024)
  • And more…

Available time formats:

  • H:i (14:30)
  • h:i a (02:30 pm)
  • g:i A (2:30 PM)

Docker-Specific Variables

When running LinkAce in Docker:

# Docker-specific database host DB_HOST=db # Redis host (if using Redis) REDIS_HOST=redis REDIS_PASSWORD=null REDIS_PORT=6379

Validation

After modifying .env:

  1. Clear configuration cache:

    php artisan config:clear
  2. Rebuild cache:

    php artisan config:cache
  3. Verify settings:

    php artisan config:show

Security Best Practices

  1. Never commit .env to version control
  2. Use strong random strings for APP_KEY
  3. Wrap passwords with special characters in quotes
  4. Disable APP_DEBUG in production
  5. Use HTTPS in production (FORCE_HTTPS=true)
  6. Restrict database access to localhost when possible
  7. Rotate API keys and secrets regularly

Troubleshooting

Configuration Not Loading

  1. Clear cache: php artisan config:clear
  2. Verify .env file exists and is readable
  3. Check for syntax errors in .env
  4. Ensure no duplicate keys

Database Connection Fails

  1. Verify DB_* credentials
  2. Check database service is running
  3. Test connection manually
  4. Ensure database exists
  5. Check firewall/network settings

Next Steps