[{"data":1,"prerenderedAt":117},["ShallowReactive",2],{"seo-verification":3,"blog-deployer-symfony-vps-en":6},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"id":7,"slug":8,"title":9,"excerpt":10,"readTime":11,"views":12,"isPinned":13,"publishedAt":14,"category":15,"categories":21,"featuredImage":23,"bgImage":24,"posterImage":25,"relatedSolution":26,"intro":28,"sections":29,"ctaTitle":72,"ctaBody":73,"ctaButton":74,"ctaUrl":75,"relatedPosts":76},48,"deployer-symfony-vps","Deploy a Symfony Application on a VPS","Deploy Symfony on a VPS: PHP-FPM, Nginx, MySQL, Composer, and SSL. A complete guide for PHP developers who want to self-host.",8,776,false,"2026-05-03T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},4,"Development","developpement","bg-warning\u002F10 text-warning","dev",[22],{"id":16,"name":17,"slug":18,"color":19,"icon":20},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fdeployer-symfony-vps-poster.svg",{"categorySlug":18,"appSlug":27},"symfony","Symfony is the PHP framework for demanding enterprise applications, structured around reusable components and a powerful service container. Deploying it on a VPS gives you control over PHP-FPM, OPcache, the database, and the cache, for performance that few shared hosting plans allow.",[30,34,44,47,69],{"type":31,"title":32,"body":33},"h2","Why Self-Host Symfony on a VPS?","Symfony requires precise PHP configuration: extensions (intl, opcache, pdo), PHP version, memory settings, and permissions on the `var\u002Fcache` and `var\u002Flog` folders. Shared hosting often imposes frozen versions and disables essential extensions, while a PaaS hides the PHP-FPM layer. On a VPS, you choose PHP 8.2\u002F8.3, enable and tune OPcache and preloading for major performance gains, and configure PHP-FPM (number of processes, pm.max_children) according to your load. You also control MySQL or PostgreSQL and the Redis cache for sessions and Doctrine. For a production Symfony application, this level of control directly determines response time.",{"type":35,"title":36,"items":37},"ul","Concrete Benefits of a Self-Hosted Symfony",[38,39,40,41,42,43],"Choice of the PHP version and all required extensions without restriction.","OPcache and Symfony preloading enabled for significantly reduced response times.","Fine-tuning of PHP-FPM (`pm.max_children`, workers) according to available RAM.","MySQL\u002FPostgreSQL database and Redis cache under your control, with scheduled backups.","Execution of console commands and Messenger (workers) continuously via systemd or Supervisor.","Atomic deployments with symbolic links, with no service interruption.",{"type":31,"title":45,"body":46},"Hardware and Software Prerequisites","A Symfony application with a database runs comfortably on 2 vCPU and 2 GB of RAM; go up to 4 GB if you add Redis, Elasticsearch, or Messenger workers. Install PHP 8.2+ with FPM and the `intl`, `opcache`, `pdo_mysql`, `mbstring`, `xml` extensions, along with Composer 2. Nginx serves as the front end, with MySQL 8 or PostgreSQL as the database. You can containerize everything with Docker (`php:8.3-fpm` image) or install natively. A domain pointed to the VPS is required for TLS. Plan for the `APP_ENV=prod` environment and asset generation via AssetMapper or Webpack Encore.",{"type":48,"title":49,"steps":50},"steps","Deploy Symfony Step by Step",[51,54,57,60,63,66],{"title":52,"body":53},"Prepare the Server and the Code","Over SSH, install PHP-FPM 8.3, the extensions, and Composer (or Docker). Clone the repository and create `.env.local` with `APP_ENV=prod`, `APP_SECRET`, and `DATABASE_URL`. Run `composer install --no-dev --optimize-autoloader`.",{"title":55,"body":56},"Compile the Cache and Assets","Run `php bin\u002Fconsole cache:clear --env=prod`, then `cache:warmup`. Compile the assets with `php bin\u002Fconsole asset-map:compile` (AssetMapper) or `npm run build` (Encore). Check the permissions on `var\u002F`.",{"title":58,"body":59},"Migrate the Database","Run `php bin\u002Fconsole doctrine:migrations:migrate --no-interaction` to apply the schema. Configure a Redis connection for sessions and the Doctrine cache if your application needs it.",{"title":61,"body":62},"Configure Nginx and PHP-FPM","Point the Nginx root to `public\u002F`, route all requests to `index.php` via `try_files`, and pass the `.php` files to the PHP-FPM socket with `fastcgi_pass`. Set `pm.max_children` according to RAM and enable OPcache in `php.ini`.",{"title":64,"body":65},"Secure with an SSL Certificate","Obtain a Let's Encrypt certificate via Certbot for `yourdomain.com`, force HTTPS, and enable automatic renewal. Block direct access to the `config\u002F`, `src\u002F`, and `var\u002F` folders at the Nginx level.",{"title":67,"body":68},"Supervise the Messenger Workers","If you use the Messenger component, declare a systemd or Supervisor service that runs `php bin\u002Fconsole messenger:consume async` continuously, with automatic restart. Schedule a cron job for `messenger:stop-workers` after deployment in order to reload the new code.",{"type":70,"body":71},"tip","Enable Symfony preloading by pointing `opcache.preload` to `var\u002Fcache\u002Fprod\u002FApp_KernelProdContainer.preload.php` in your `php.ini`. The service container and the framework classes are then loaded once into memory at PHP-FPM startup, which eliminates a significant part of the autoloading cost on each request and noticeably reduces latency in production.","Put Your Symfony into Production","The ServOrbit Cloud VPS offers a template with PHP-FPM, Nginx, a database, and automatic SSL, ready to host your Symfony applications optimized with OPcache.","Deploy My Symfony VPS","\u002Fvps-cloud",[77,91,104],{"id":78,"slug":79,"title":80,"excerpt":81,"readTime":82,"views":83,"isPinned":13,"publishedAt":84,"category":85,"categories":86,"featuredImage":23,"bgImage":24,"posterImage":88,"relatedSolution":89},5,"deployer-laravel-vps","Deploying Laravel on a VPS: a production guide","Take Laravel to production on a VPS: PHP, workers, cache, database, reverse proxy and HTTPS configured cleanly.",7,2840,"2026-02-09T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},[87],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fdeployer-laravel-vps-poster.svg",{"categorySlug":20,"appSlug":90},"laravel-stack",{"id":92,"slug":93,"title":94,"excerpt":95,"readTime":11,"views":96,"isPinned":13,"publishedAt":97,"category":98,"categories":99,"featuredImage":23,"bgImage":24,"posterImage":101,"relatedSolution":102},43,"deployer-nodejs-vps","Deploy a Node.js Application on a VPS","Deploy a Node.js application to production on a VPS: PM2, Nginx reverse proxy, Let's Encrypt SSL, and automatic startup at boot.",591,"2026-05-08T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},[100],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fdeployer-nodejs-vps-poster.svg",{"categorySlug":18,"appSlug":103},"nodejs",{"id":105,"slug":106,"title":107,"excerpt":108,"readTime":11,"views":109,"isPinned":13,"publishedAt":110,"category":111,"categories":112,"featuredImage":23,"bgImage":24,"posterImage":114,"relatedSolution":115},44,"deployer-django-vps","Deploy a Django Application on a VPS","Deploy Django on a VPS: Gunicorn, Nginx, PostgreSQL, Docker, and SSL. A complete guide for Python developers who want to self-host.",628,"2026-05-07T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},[113],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fdeployer-django-vps-poster.svg",{"categorySlug":18,"appSlug":116},"django",1785628432523]