Install WordPress with FrankenPHP

Table of Contents
Check out how to install WordPress with LEMP stack
FrankenPHP #
The writeup for how to install FrankenPHP
Add the frankenphp user to the www-data group:
usermod -aG www-data frankenphp
Required packages #
apt install mariadb-server
MySQL #
Create the user and the DB:
mysql --execute="CREATE DATABASE example_com; GRANT ALL PRIVILEGES ON example_com.* TO 'wpuser'@'localhost' IDENTIFIED BY 'SECURE_PASSWORD' WITH GRANT OPTION; FLUSH PRIVILEGES;"
To generate a random password:
tr -dc A-Za-z0-9 </dev/urandom | head -c 15; echoFiles #
Create the /var/www directory:
mkdir -p /var/www
Download and extract #
Download the latest version:
wget "https://wordpress.org/latest.tar.gz"
Extract to /var/www/:
tar -xf "latest.tar.gz" -C "/var/www/"
Rename the wordpress directory to the used domain:
mv /var/www/wordpress /var/www/example.com
wp-config.php #
Create the wp-config.php:
cp "/var/www/example.com/wp-config-sample.php" "/var/www/example.com/wp-config.php"
Change the permission:
chmod 0660 "/var/www/example.com/wp-config.php"
Configure the WordPress:
nano "/var/www/example.com/wp-config.php"
Owner and group #
Change the owner and the group of the files:
chown -R www-data:www-data /var/www/example.com
Caddyfile #
nano /etc/frankenphp/Caddyfile
{
frankenphp {
php_ini "auto_prepend_file" "/var/www/example.com/wordfence-waf.php"
}
}
example.com {
php_server {
root /var/www/example.com
}
log
encode zstd br gzip
}
Reload FrankenPHP:
systemctl reload frankenphp