Need to migrate your e-mails to a new server? Free and paid versions of our online tool available.
Hero Image

Install WordPress on AlmaLinux 9 (Nginx+PHP-FPM+MySQL)

Install WordPress on AlmaLinux 9 (Nginx + PHP-FPM + MySQL)

Prerequisites

Step 1 – Database

CREATE DATABASE wordpress CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'WPStrongPass!';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;

Step 2 – Download WordPress

curl -O https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz -C /var/www/example.com/
chown -R www-data:www-data /var/www/example.com/wordpress 2>/dev/null || chown -R nginx:nginx /var/www/example.com/wordpress

Step 3 – wp-config.php

cp /var/www/example.com/wordpress/wp-config-sample.php /var/www/example.com/wordpress/wp-config.php

Set DB credentials and generate secret keys from https://api.wordpress.org/secret-key/1.1/salt/.

Step 4 – Nginx block

server {
    listen 80;
    server_name example.com;
    root /var/www/example.com/wordpress;
    index index.php;
    location / { try_files $uri $uri/ /index.php?$args; }
    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass unix:/run/php-fpm/www.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
    location ~* \.(css|js|png|jpg|gif|ico|woff2?)$ { expires 365d; }
    client_max_body_size 64M;
}

Step 5 – Finish

Visit http://example.com and complete the WordPress setup wizard.