DropVPS Team
Writer: John hens
How to install laravel on Centos 9/8

Table of Contents
What you will read?
Laravel is one of the most popular PHP frameworks for modern web development. Installing it on CentOS requires PHP, Composer, and proper permissions for the project directory.
Step 1: Update CentOS Packages
Before installing Laravel, update your system to make sure all existing packages are current:
sudo dnf update -y
Step 2: Install PHP and Required Extensions
Laravel needs PHP 8.3 or higher along with some common extensions. Install them with:
sudo dnf install php php-cli php-mbstring php-xml php-bcmath unzip curl git -y
Step 3: Install Composer
Composer is required to install Laravel and manage dependencies. Run the following commands:
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
Verify installation:
composer -V
Step 4: Create a New Laravel Project
Now it’s time to install Laravel. Move to your web directory and run Composer to create the project:
cd /var/www/
composer create-project laravel/laravel myproject
Replace myproject with the name of your application.
Step 5: Set Permissions for Laravel
To make sure Laravel runs properly, give the correct permissions to its storage and cache directories:
sudo chown -R apache:apache /var/www/myproject
sudo chmod -R 775 /var/www/myproject/storage /var/www/myproject/bootstrap/cache
Laravel is now installed on CentOS 8/9. The project directory has the correct permissions, and you can start developing your application.