DEV Community

Cover image for Install Laravel Valet+ Ubuntu
Fady Mondy
Fady Mondy

Posted on

Install Laravel Valet+ Ubuntu

we are recommending using our environment to make the project work we are using Ubuntu Linux and Laravel valet+

Install BackBox Linux "Recommendation"

I like to use BackBox Linux because it has a lot of tools and supports our environment, so from the link, we keep downloading the ISO image and putting it in USB using Rufus and then booting your computer into it

Install dependencies packages

let's start by opening our terminal and updating the system to the last one, and after that install some packages

sudo add-apt-repository -y ppa:nginx/stable
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
Enter fullscreen mode Exit fullscreen mode
sudo apt-get upgrade
Enter fullscreen mode Exit fullscreen mode

after it finished reboot your computer and after that run this command

sudo apt-get install network-manager libnss3-tools jq xsel
Enter fullscreen mode Exit fullscreen mode

Install PHP & its extensions

sudo apt install php8.2-fpm
Enter fullscreen mode Exit fullscreen mode
sudo apt install php8.2-cli php8.2-common php8.2-curl php8.2-mbstring php8.2-opcache php8.2-readline php8.2-xml php8.2-zip php8.2-mysql php8.2-gd
Enter fullscreen mode Exit fullscreen mode

Install MySql Server

sudo apt-get -y install mysql-server
Enter fullscreen mode Exit fullscreen mode
sudo mysql_secure_installation
Enter fullscreen mode Exit fullscreen mode

use 0 for the password and use any password something like 12345678

after the installation is finished, start the MySQL server

sudo mysql
Enter fullscreen mode Exit fullscreen mode

and on the MySQL server console use this command

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '12345678';
Enter fullscreen mode Exit fullscreen mode
mysql> FLUSH PRIVILEGES;
Enter fullscreen mode Exit fullscreen mode
mysql> exit;
Enter fullscreen mode Exit fullscreen mode

Install Composer

sudo apt install curl
Enter fullscreen mode Exit fullscreen mode
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
Enter fullscreen mode Exit fullscreen mode

Install PHPMyAdmin

the valet has been installed now, let's go and install PHPMyAdmin and link it with the .test subdomain using valet first of all, create a folder for your sites on the home directory ~

cd ~
mkdir Sites
cd Sites
Enter fullscreen mode Exit fullscreen mode

now we are on the Sites path, let's park this directory to be the directory of our projects

valet park
Enter fullscreen mode Exit fullscreen mode

now any project on this directory will be auto-linked with subdomain .test, let's download PHPMyAdmin from this link and unzip the file inside the Sites directory and rename the folder to PHPMyAdmin, after that go inside the folder and use this command

cp config.sample.inc.php config.sample.php
nano config.sample.php
Enter fullscreen mode Exit fullscreen mode

change the line to

$cfg['blowfish_secret'] = 'YK07LhNSe50vrj,HwBfb.l3gpbv;u8b7',
Enter fullscreen mode Exit fullscreen mode

now use CTRL + x and say Y now we will use valet to link PHPMyAdmin and secure the link with SSL

valet link
valet secure
valet open
Enter fullscreen mode Exit fullscreen mode

now you can see the PHPMyAdmin working and you can use root as the user and the password you created to MySQL to login

Install Valet

composer global require genesisweb/valet-linux-plus
Enter fullscreen mode Exit fullscreen mode

no, you need to export Valet use

PATH="$PATH:$HOME/.composer/vendor/bin"
Enter fullscreen mode Exit fullscreen mode

Or use the following

PATH="$PATH:$HOME/.config/composer/vendor/bin"
Enter fullscreen mode Exit fullscreen mode

and now it will be easy to start installing valet

valet install
Enter fullscreen mode Exit fullscreen mode

it will ask you for a password input 12345678

Top comments (0)