Deployment Basics
Deployment Basics
~17 Min. Lesezeit Zuletzt aktualisiert am August 8, 2026
Time to actually get aufgaben-manager onto a production server – a SYSTEMATIC checklist that ties every step from this course into a working whole.
1. Installing dependencies for production
composer install --no-dev --optimize-autoloader--no-dev skips require-dev packages (chapter 6) – maker-bundle, PHPUnit (chapter 42), and friends are NOT needed in production and would only add unnecessary attack surface and disk space. --optimize-autoloader builds a more performant, class-indexed autoloader instead of the slower default variant.
2. Setting environment variables for production
APP_ENV=prod
APP_SECRET=A_REAL_RANDOM_VALUE_NEVER_REUSE_THE_DEV_ONE
DATABASE_URL="postgresql://production_user:secure_password@production-db-host:5432/aufgaben_manager?serverVersion=16&charset=utf8"
MAILER_DSN=smtp://real-provider.com:587Achtung: EXACTLY as learned in chapter 4: .env.local is NEVER version-controlled. APP_SECRET MUST be REGENERATED for production (NEVER reuse the local development one) – it's used for, among other things, CSRF token generation (chapter 18) and signatures.
3. Warming up the cache ahead of time
php bin/console cache:clear --env=prod
php bin/console cache:warmup --env=prodEXACTLY the production cache explained in chapter 4 – if it's NOT warmed up ahead of time, the FIRST user after every deployment pays the cost of building the cache (a noticeably slow first request).
4. Running database migrations
php bin/console doctrine:migrations:migrate --env=prod --no-interactionAchtung: --no-interaction from chapter 40 is REQUIRED HERE for automated deployments. Check BEFORE every production deployment whether the new migrations are ACTUALLY compatible with the data already present in production – a column that was empty in the development database might hold real values in production that a migration must NOT damage.
5. Compiling static assets
php bin/console asset-map:compileBuilds the files referenced with asset() from chapter 14 for production, INCLUDING cache-busting hashes in the filename – if app.css changes, the new version gets a NEW filename, so browsers do NOT accidentally keep using the old, cached version.
The complete checklist at a glance
composer install --no-dev --optimize-autoloader- Check environment variables (
APP_ENV=prod, a realAPP_SECRET, a realDATABASE_URL) php bin/console cache:clear --env=prod && cache:warmup --env=prodphp bin/console doctrine:migrations:migrate --env=prod --no-interactionphp bin/console asset-map:compile- Check file permissions for
var/cacheandvar/log(the web server user needs write access) - Check the HTTPS certificate and security headers
One last check: bin/console about
php bin/console about --env=prodTipp: Shows the ACTIVE environment, PHP version, and installed bundles – a quick, final look to confirm the application is ACTUALLY running in the prod environment and hasn't accidentally kept using dev configuration (which would expose debug information to EVERY visitor – a serious security risk).
With that, block 8 – and this ENTIRE course – is ALMOST complete! One closing chapter ties together everything learned and rounds off aufgaben-manager.