The official Laravel Valet development environment is great for Apple users, but there is no official Valet for Linux or Windows. However, the community has created two versions of Valet for Linux:
- cpriego/valet-linux (Valet Linux)
- genesisweb/valet-linux-plus (Valet Linux+)
- nvm-sh/nvm (Node Version Manager)
Among these, Valet Linux+ has more features, such as MySQL database handling from the command line, MailHog, Redis, sharing sites on LAN, securing sites with TLS (HTTPS), and more.
This guide will show you how to install Valet Linux+ on an Ubuntu system.
- Ubuntu base distro
sudo apt-get install network-manager libnss3-tools jq xselAdd the PHP PPA and install PHP 8:
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.0-fpmInstall required PHP extensions:
sudo apt install php8.0-cli php8.0-common php8.0-curl php8.0-mbstring php8.0-opcache php8.0-readline php8.0-xml php8.0-zip php8.0-mysql php8.0-gdInstall other PHP version:
sudo apt install php<version>-fpmInstall required PHP extensions:
sudo apt install php<version>-cli and other do the sameValet Linux+ installs MySQL automatically, but it's better to install it manually:
sudo apt-get -y install mysql-serversudo mysqlThen, run the following commands in the MySQL shell:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
FLUSH PRIVILEGES;
exit;Now, you can log in using:
mysql -u root -pInstall Composer using curl:
sudo apt install curl
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composerVerify installation:
composer --versioncomposer global require genesisweb/valet-linux-plusAdd the following to your shell profile (~/.bash_profile, ~/.bashrc, or ~/.zshrc):
export PATH="$PATH:$HOME/.config/composer/vendor/bin"Reload configuration using :
source ~/.zshrcRestart your terminal and install Valet:
valet installThis installs Valet Linux+, Nginx, MySQL, Redis, Mailhog, and DnsMasq.
Run:
ping -c1 foobar.testvalet parkvalet linkvalet linksvalet securecurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bashAttempts to add the source lines from the snippet below to the correct profile file (~/.bash_profile, ~/.zshrc, ~/.profile, or ~/.bashrc).
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvmReload configuration using :
source ~/.zshrcCheck the installed version, by running:
nvm --versionSee list all available node.js versions:
nvm ls-remote
Install latest LTS version of node:
nvm install --lts