Install php: resource
sudo apt update && sudo apt -y upgrade
sudo systemctl reboot
sudo apt update
sudo apt install lsb-release ca-certificates apt-transport-https software-properties-common -y
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.1
sudo apt install php8.1-{xml,crul,dom}
Install a database manager: resource
sudo apt install mariadb-server
sudo mysql_secure_installation
And after we define the root password:
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] n
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n]
Install Composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer
Install Laravel
composer create-project --prefer-dist laravel/laravel [project_name]
Now, you car run php artisan serve
, safely.