Environment Configuration
MediaStream uses a.env file for environment-specific configuration. This file is created from .env.example during installation.
Core Application Settings
Application Identity
.env
Your application name. This appears in:
- Page titles
- Email notifications
- Default branding
Application environment. Common values:
local- Developmentstaging- Pre-productionproduction- Live environment
Encryption key for securing session data and encrypted values.Generated automatically with
php artisan key:generate.Enable detailed error messages and debugging tools.
The base URL of your application. Used for:
- Generating links in emails
- Asset URL generation
- API responses
Localization
.env
Default application language.
Language to use when the requested locale is unavailable.
Locale for generating fake data in tests and seeders.
Maintenance Mode
.env
Storage driver for maintenance mode state:
file- Store in filesystemdatabase- Store in databasecache- Store in cache
Security Settings
Encryption
.env
Number of rounds for bcrypt password hashing.Higher values = more secure but slower:
10- Fast, less secure12- Balanced (recommended)14+- Slower, more secure
Database Configuration
MediaStream supports multiple database systems:- SQLite (Default)
- MySQL
- PostgreSQL
.env
SQLite is perfect for development but consider MySQL/PostgreSQL for production.
Session Configuration
.env
Where to store session data:
file- Filesystem storagecookie- Browser cookiesdatabase- Database storage (recommended)redis- Redis cachememcached- Memcached cache
Database sessions require the sessions table. Run migrations if switching drivers:
Session lifetime in minutes (2 hours by default).
Whether to encrypt session data.
Enable for sensitive applications, but increases overhead.
Queue Configuration
.env
Queue driver for background jobs:
sync- Process immediately (no queue)database- Database-backed queueredis- Redis queue (recommended for production)sqs- Amazon SQS
Queue workers must be running to process jobs:
Cache Configuration
.env
Cache driver for application caching:
file- File-based cachedatabase- Database cacheredis- Redis cache (recommended)memcached- Memcached cachearray- Array cache (testing only)
Prefix for cache keys to avoid collisions when sharing cache storage.
File Storage
.env
Default filesystem disk:
local- Local storage instorage/apppublic- Public storage instorage/app/publics3- Amazon S3
Amazon S3 Configuration
For cloud storage, configure AWS S3:.env
Logging Configuration
.env
Logging channel:
stack- Multiple channelssingle- Single log filedaily- Daily rotated logsstderr- Standard error outputsyslog- System log
Minimum log level to record:
debug- All messagesinfo- Informational and abovewarning- Warnings and errorserror- Errors onlycritical- Critical errors only
Mail Configuration
.env
- Log (Development)
- SMTP
- Mailgun
- Postmark
In development, emails are logged instead of sent:View emails in:
.env
Redis Configuration
.env
Redis client library:
phpredis- PHP extension (faster)predis- Pure PHP client
Redis is optional but recommended for:
- Caching
- Queue management
- Session storage
- Real-time features
Memcached Configuration
.env
Memcached server hostname.
Frontend Configuration
Vite Environment Variables
.env
VITE_* variables are accessible in frontend code:
Changes to
.env variables require restarting the Vite dev server:Additional Frontend Variables
Add custom variables for frontend use:.env
Performance Tuning
PHP Server Workers
.env
Number of PHP workers for the built-in server.
Production Checklist
Before deploying to production:Security
- Use HTTPS (
APP_URL=https://...) - Set strong
APP_KEY - Secure database credentials
- Enable session encryption if needed
Configuration Caching
For better performance, cache configuration:Next Steps
Series Management
Learn how to manage series, seasons, and episodes
User Authentication
Configure authentication and security features
Architecture
Understand the technical architecture
API Reference
Explore the REST API documentation