Skip to content

Instantly share code, notes, and snippets.

@AzadGh95
Last active November 30, 2022 06:56
Show Gist options
  • Save AzadGh95/788c8cd2337eaf500924d39785fed8a6 to your computer and use it in GitHub Desktop.
Save AzadGh95/788c8cd2337eaf500924d39785fed8a6 to your computer and use it in GitHub Desktop.
How to run laravel project on Ubuntu 22.04

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment