Deployment guide

Deploying Laravel on a VPS: a production guide

Deploy on a VPS Cloud →

Development7 min read

Deploying Laravel on a VPS: a production guide

Laravel demands more than basic PHP hosting as soon as queues, cache and scheduled tasks come into play. A ServOrbit VPS lets you choose the PHP version, isolate workers and drive deployment with the same rigor as on your local machine. This guide focuses on the production path: dependencies, variables, migrations, queue workers and HTTPS.

Why host Laravel on a VPS?

Shared hosting imposes constraints incompatible with the real needs of a Laravel application: PHP often limited to a single version, no way to run an Artisan process in the background or to configure a real cron scheduler. On a VPS, you have a dedicated environment where every component of the stack (PHP-FPM, Nginx, MySQL or PostgreSQL, Redis) is configured precisely according to your needs, without sharing resources with other clients. It is the natural solution as soon as your project outgrows the prototype stage or you have performance, security and availability requirements.

What you can do with Laravel on a VPS

  • Run persistent queue workers (jobs, emails, notifications) with Laravel Horizon or Supervisor, with no time limit imposed by a host
  • Schedule recurring tasks via the Artisan scheduler (php artisan schedule:run) triggered by a real system cron every minute
  • Serve a high-availability REST or GraphQL API with controlled response times thanks to OPcache and Redis configured freely
  • Deploy several environments (staging, production) on a single VPS by isolating each application in its own Nginx vhost
  • Enable specific PHP extensions (imagick, gmp, sodium…) or switch PHP version (8.1, 8.2, 8.3) without depending on customer support
  • Integrate modern DevOps tools like Envoyer, Deployer or GitHub Actions directly from your CI/CD pipeline

Install Laravel on your ServOrbit VPS

01

Order a ServOrbit Cloud VPS

Go to the /vps-cloud page and choose the plan suited to your project — for a standard Laravel application, an instance with 2 vCPU and 2 GB of RAM is a good starting point. Select Ubuntu 22.04 LTS as the operating system and confirm your order. Your VPS is provisioned in under two minutes.

02

Access the Marketplace from the client area

Log in to your ServOrbit client area, then navigate to the "VPS" section and click your instance. In the management panel, click the "Marketplace" tab to access the library of ready-to-use applications.

03

Select Laravel and start the installation

In the Marketplace, search for "Laravel" and click the application card. The installer automatically deploys the full stack: Nginx as the web server, PHP-FPM (8.2 by default), MySQL 8.0 and Composer. Click "Install" and wait two to three minutes while the script configures the entire environment.

04

Retrieve the credentials and access your application

Once the installation is complete, the client area displays a summary containing your VPS IP address, the generated MySQL credentials (database, user and password), as well as the application's root path (/var/www/laravel/public). Your application is accessible via http://<IP-du-VPS> on port 80. Connect via SSH with ssh root@<IP> to perform the initial configuration: edit the .env file, run php artisan key:generate if it is not already done, and run the migrations with php artisan migrate.

05

Point your domain and enable HTTPS

In your DNS manager, create an A record pointing your domain to the VPS IP. Then, from the VPS via SSH, install Certbot and obtain a free Let's Encrypt certificate with the command certbot --nginx -d mydomain.com. Nginx is automatically reconfigured to redirect all HTTP traffic to HTTPS, and your Laravel application is now securely accessible on your custom domain.

Before going to production, set APP_ENV=production and APP_DEBUG=false in your .env file — leaving debug mode on exposes your application's structure and sensitive environment variables in the error messages shown to visitors. Also enable configuration and route caching with php artisan config:cache && php artisan route:cache to gain up to 30% in performance on response times.

The official documentation

For advanced configuration, tool-specific options and version changes, refer to the official Laravel documentation. This guide covers going live on a ServOrbit VPS; the vendor documentation remains the reference for fine-tuning.

Deploy Laravel in minutes on a ServOrbit Cloud VPS

Order your Cloud VPS right now and launch your Laravel application in production in under five minutes thanks to the ServOrbit Marketplace.

Need help?

Browse our help center and FAQ, or write to our team — support in French, English and Arabic.