DropVPS Team
Writer: John hens
How to install laravel on debian 12

Table of Contents
What you will read?
Laravel is a powerful PHP framework. Installing it on Debian 12 requires updating your system and installing the necessary PHP packages and Composer.
Step 1: Update Debian 12
First, make sure your system is up to date so you won’t face dependency issues later:
sudo apt update && sudo apt upgrade -y
Step 2: Install PHP and Extensions
Laravel requires PHP 8.3 or newer. Install PHP and the required extensions with:
sudo apt install php php-cli php-mbstring php-xml php-bcmath unzip curl git -y
Step 3: Install Composer
Composer is needed to install Laravel. Run these commands:
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
Check it:
composer -V
Step 4: Create Laravel Project
Now install Laravel with Composer. Navigate to your web directory and run:
cd /var/www/
composer create-project laravel/laravel myproject
Replace myproject with your project’s name.
Step 5: Set Laravel Permissions
Give proper permissions to storage and cache directories so Laravel can run correctly:
sudo chown -R www-data:www-data /var/www/myproject
sudo chmod -R 775 /var/www/myproject/storage /var/www/my project/bootstrap/cache
Laravel is now installed on Debian 12. You can start building and running your PHP applications.