How to Install WordPress with LEMP on AlmaLinux 10
WordPress is a commonly used PHP-based CMS (Content Management System). For small businesses, personal blogs & websites, WordPress can be a good fit. In this article, we are going to learn how to install WordPress on AlmaLinux 10. So, let’s get started.
Pre-requisites:
- A system with AlmaLinux 10 installed and running.
root
access to the system.- LEMP Stack installed and running, for this, you can refer to one of our guides on installing the LEMP Stack (Nginx, MariaDB and PHP).
Once you're all set, we'll proceed with WordPress installation and configuration.
Install Wget & Developer Tools
yum groupinstall "Development tools"
yum install wget
Output
yum install wget
Last metadata expiration check: 0:01:57 ago on Mon Jun 23 10:46:30 2025.
Dependencies resolved.
=============================================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================================
Installing group/module packages:
asciidoc noarch 10.2.0-12.el10 appstream 428 k
autoconf noarch 2.71-12.el10 appstream 738 k
automake noarch 1.16.5-20.el10 appstream 705 k
bison x86_64 3.8.2-9.el10 appstream 1.0 M
byacc x86_64 2.0.20230521-7.el10 appstream 115 k
diffstat x86_64 1.66-3.el10 appstream 45 k
flex x86_64 2.6.4-19.el10 appstream 301 k
gcc x86_64 14.2.1-7.el10.alma.1 appstream 37 M
gcc-c++
Download WordPress
First, navigate to the /var/www directory as follows:
cd /var/www/html
Now, download the latest WordPress archive from the official website of WordPress with the following command:
wget https://wordpress.org/latest.tar.gz
Output
[root@vps ~]# cd /var/www/html
[root@vps html]# wget https://wordpress.org/latest.tar.gz
--2025-06-23 10:49:44-- https://wordpress.org/latest.tar.gz
Resolving wordpress.org (wordpress.org)... 198.143.164.252
Connecting to wordpress.org (wordpress.org)|198.143.164.252|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 26926501 (26M) [application/octet-stream]
Saving to: ‘latest.tar.gz’
latest.tar.gz 100%[========================================================================================>] 25.68M 16.9MB/s in 1.5s
2025-06-23 10:49:46 (16.9 MB/s) - ‘latest.tar.gz’ saved [26926501/26926501]
Check for files with the following command:
ls
Now, extract the WordPress archive file latest.tar.gz with the following command:
tar xvzf latest.tar.gz
Once the WordPress archive file latest.tar.gz is extracted, a new directory wordpress/
should be created in the folder. Now, you can remove the latest.tar.gz file as follows:
rm -v latest.tar.gz
Setting up File Permission & Ownership
Now, change the owner and group of the wordpress/
directory and its contents to Nginx as follows:
chown -R nginx:nginx /var/www/html/wordpress
Now, change the permission of the wordpress/
directory and its content to 775 as follows:
chmod -Rf 775 ./wordpress/
Configuring Nginx vHost
Now, create a new Nginx configuration file wordpress.conf
for WordPress with the following command:
vi /etc/nginx/conf.d/wordpress.conf
Now, press i
to go to INSERT
mode and type in the following lines of code in the wordpress.conf
file.
server {
listen 80;
server_name dev.domainhere.info www.dev.domainhere.info;
root /var/www/html/wordpress;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$args;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/run/php-fpm/www.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Change yourdomain.com with
Your Domain Name
. If you are using an IP, please remove the entire server_name line.
Now, press the Esc
key, type in :wq!
, and press the Enter
key to save and exit the file.
Now, restart & check the Nginx service with the following commands:
systemctl restart nginx.service
Configuring Database
Now create a Database, User & Password for WordPress:
mysql -u root
CREATE DATABASE wordpress;
CREATE USER 'username'@'localhost' IDENTIFIED BY 'strong_password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'username'@'localhost';
FLUSH PRIVILEGES;
quit
Note: Replace
Configuring WordPress
Now open the IP address from your browser, this will redirect you to the wp-admin part of configuring the final parts of WordPress installation.
http://IP_address
Replace the
IP_address
with the actual IP of the server.
Input the Database details which were configured earlier.
Now you have to make wp-config.php
file and copy the code from the screen and paste it into wp-config.php:
cd /var/www/html/wordpress
vi wp-config.php
Now paste the code.
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the installation.
* You don't have to use the website, you can copy this file to "wp-config.php"
* and fill in the values.
*
* This file contains the following configurations:
*
* * Database settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* @link https://developer.wordpress.org/advanced-administration/wordpress/wp-config/
*
* @package WordPress
*/
// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress' );
/** Database username */
define( 'DB_USER', 'username' );
/** Database password */
define( 'DB_PASSWORD', 'strong_password' );
/** Database hostname */
define( 'DB_HOST', 'localhost' );
/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8mb4' );
/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
/**#@+
* Authentication unique keys and salts.
*
* Change these to different unique phrases! You can generate these using
* the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.
*
* You can change these at any point in time to invalidate all existing cookies.
* This will force all users to have to log in again.
*
* @since 2.6.0
*/
define( 'AUTH_KEY', '7uZqa*Wn(fHp&:Ga>xm0c5hk3X1a{1e%3Ik/}lE[1i*Q,y)C53}Bdm:<iu0-Z_H;' );
define( 'SECURE_AUTH_KEY', '6(.)8oPb)=Ku_-G;hM46qp,sHqLX*Fz1a2*:R!ZKv9)l]C.)bb1pClBx3d!PPc#Z' );
define( 'LOGGED_IN_KEY', 'R7^3bh)&z);h&^PF+B1@</lkIs+&]%a3BWI3W1Bk^1!f<7xlA[Mae>F.X7s$ O(*' );
define( 'NONCE_KEY', '*FQhy00Tc4Nu2:r`d{wbAv/3VdkZvz*P7*(-QR#u7{LaXcN5S?0X]st!TZO]Ju]!' );
define( 'AUTH_SALT', 'ho!zOJ o/+8G#a:v=<.cy0_p[*?>u]40NkwlBbU}u8]iZ7#pt[)]U +7-`g(x5^D' );
define( 'SECURE_AUTH_SALT', '.@|v1bTkfgooz,7>%8pH3}*brEA+q@5nf-j`u]{ #3p&qJ~o |0aF8&`fw?VDoX9' );
define( 'LOGGED_IN_SALT', 'q40y`Admw=0.m;XQ}pm-Qzd-2! .09S2JJ/Tj[onDO!EtmY/byaoG,7^5Qnr$_:8' );
define( 'NONCE_SALT', ':.8CYjN%nJ;q8C0rZcyWsAnr>FmOLks.d+6Akarko2f =NH0. hFY/IZEZv&FCJ}' );
/**#@-*/
/**
* WordPress database table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*
* At the installation time, database tables are created with the specified prefix.
* Changing this value after WordPress is installed will make your site think
* it has not been installed.
*
* @link https://developer.wordpress.org/advanced-administration/wordpress/wp-config/#table-prefix
*/
$table_prefix = 'wp_';
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the documentation.
*
* @link https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/
*/
define( 'WP_DEBUG', false );
/* Add any custom values between this line and the "stop editing" line. */
/* That's all, stop editing! Happy publishing. */
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}
/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';
Note: Update the Database details, Username, Password, Database Names
Now, press the Esc
key, type in :wq!
, and press the Enter
key to save and exit the file.
Continue with the installation. Once completed, you have successfully installed WordPress with LEMP on AlmaLinux 10.
✅ Conclusion
You’ve successfully installed WordPress on AlmaLinux 10 using the LEMP stack (Linux, Nginx, MariaDB, PHP 8.4). This setup offers a modern, high-performance environment for running WordPress with improved speed and flexibility over traditional LAMP setups.
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME
for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS