Exclusive Metin2 game shield on FreeBSD: Automatic siege mode, VIP list, and whitelist from your dashboard. See how it works
Create a server

Guide

How to Install Laravel on a VPS

Laravel fits well on an Ubuntu VPS with PHP-FPM and Nginx (or Apache). Minimal path: dependencies, create-project, then storage permissions.

Steps

  1. Install PHP, common extensions and Composer:

    sudo apt update
    sudo apt install -y php-cli php-fpm php-mbstring php-xml php-curl php-zip unzip
    curl -sS https://getcomposer.org/installer | php
    sudo mv composer.phar /usr/local/bin/composer
  2. Create the project:

    cd /var/www
    sudo composer create-project laravel/laravel my-app
  3. Fix ownership and permissions on storage and bootstrap/cache:

    sudo chown -R www-data:www-data /var/www/my-app
    sudo chmod -R ug+rwx /var/www/my-app/storage /var/www/my-app/bootstrap/cache
  4. Point the Nginx document root to /var/www/my-app/public and wire PHP-FPM.

Tips

  • Copy .env, generate APP_KEY and configure the database.
  • Run queue workers and the scheduler (cron) in production.

ext step

eed a VPS ready for PHP and Nginx? Deploy on Xernode.

Related guides