Add repository:
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list sudo apt update
Install PHP 8.0 with command line interface (CLI):
sudo apt install -y php8.0-common php8.0-cli
Add additionally modules to support DBs, mbstring, etc.
sudo apt install -y php8.0-curl php8.0-gd php8.0-mbstring php8.0-xml php8.0-zip php8.0-mysqli # php8.0-pgsql if it's installed
Add Appache mod and restart the server
sudo apt install -y libapache2-mod-php8.0 sudo service apache2 restart