Valet Linux+

Requirements

PHP

Valet Linux+ requires PHP 8.2 or higher for its CLI. Older PHP versions (7.0 – 8.1) can still be used to serve individual sites through isolation.

OS packages

Valet checks for jq, xsel and certutil (from NSS tools) before running privileged commands and refuses to continue if any of them is missing. Install the packages for your distribution below.

Ubuntu / Debian

Requirement Description
Ubuntu version 20.04+
OS packages sudo apt-get install curl libnss3-tools jq xsel openssl ca-certificates
PHP version 8.2+
PHP extensions php*-cli php*-curl php*-mbstring php*-xml php*-zip php*-posix

Replace the star * with your PHP version (e.g. php8.3-cli).

Installing PHP versions

Ubuntu's default repositories ship a single PHP version. To install PHP 8.2 – 8.5 side by side, use the ondrej/php PPA:

bash
sudo apt-get install -y software-properties-common ca-certificates curl
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update

Then install each version with PHP-FPM and the extensions commonly used by Laravel:

bash
for v in 8.2 8.3 8.4 8.5; do
  sudo apt-get install -y php$v \
    php$v-{cli,fpm,common,mbstring,xml,curl,zip} \
    php$v-{bcmath,intl,gd,mysql,pgsql,sqlite3,redis,readline}
done
sudo apt-get install -y php8.2-opcache php8.3-opcache php8.4-opcache
sudo apt-get install -y unzip git

PHP 8.5 has no separate php8.5-opcache package because OPcache is built into PHP. PHP 8.1 is optional; install it the same way only if you plan to isolate older sites to it.

Each version gets its own binary (php8.2, php8.5, …) and FPM socket (/run/php/php8.4-fpm.sock). To change the system's default php command, run sudo update-alternatives --config php, or let Valet do it with valet use {version} --update-cli.

Tip

Prefer a single command? The install-php.sh script automates these steps for Ubuntu 24.04 and derivatives such as Linux Mint 22, Zorin OS 18 and Pop!_OS. It adds the PPA using the Ubuntu base of your distribution, which add-apt-repository can get wrong on derivatives, and skips packages that do not exist for a given version:

bash
curl -fsSLO https://raw.githubusercontent.com/FernandoEbert/linux-development-environment/324d19363f9da331b35416b96826a44019e04dbe/install-php.sh
chmod +x install-php.sh

# Install the given versions (default: 8.1 – 8.5)
sudo ./install-php.sh 8.2 8.3 8.4 8.5

# Same, and make 8.4 the default `php` command
sudo PHP_DEFAULT=8.4 ./install-php.sh 8.2 8.3 8.4 8.5

Ubuntu 20.04

To use valet secure on Ubuntu 20.04, add the Nginx PPA, because the Nginx version in the default repositories does not support http2:

bash
sudo add-apt-repository -y ppa:nginx/stable
sudo apt-get update

Fedora

Requirement Description
Fedora version 39+
OS packages sudo dnf install curl nss-tools jq xsel openssl ca-certificates
PHP version 8.2+
PHP extensions sudo dnf install php-{cli,curl,process,mbstring,xml,zip,posix}

Regarding SELinux

Fedora users are expected to know how to configure or disable SELinux while Valet makes changes to system files; otherwise you will receive errors about changes that could not be made. valet install aborts when SELinux is in enforcing mode.

The easiest way is to set SELinux to permissive mode:

  • Temporarily (until reboot): sudo setenforce 0
  • Permanently: open /etc/selinux/config, change SELINUX=enforcing to SELINUX=permissive and reboot.

If you know what you are doing and want to skip the check, use:

bash
valet install --ignore-selinux

Arch Linux

Requirement Description
OS packages sudo pacman -S nss jq xsel networkmanager ca-certificates
PHP version 8.2+
PHP extensions sudo pacman -S php (the Arch package already bundles cli, curl, mbstring, xml, zip and posix)

Supported package managers

Valet detects the system package manager to install Nginx, PHP-FPM, DnsMasq, MySQL/MariaDB and Redis:

  • apt (Ubuntu, Debian and derivatives)
  • dnf / yum (Fedora, RHEL-based)
  • pacman (Arch Linux, Manjaro)
  • eopkg (Solus)
  • PackageKit (fallback)

Services are managed through systemd, with a fallback to the classic service command.

Regarding sudo and the root user

Valet automatically uses sudo to perform some of its tasks. Your user must therefore be configured as a sudo user.

Warning

Do not, under any circumstance, install Valet as root or with sudo. Kittens could die. Valet refuses to install when its home directory resolves inside /root.