How to Install WordPress with LEMP Stack on Ubuntu 25.10

WordPress is one of the most popular website-building tools available today. It’s a simple way to create an online presence — perfect for users who don’t know how to code but still want to build and manage a website easily.

Prerequisites

Creating Database

Log into MySQL with the following command.

mysql -u root -p

Inside the MySQL shell, run the following commands to create a database and user for WordPress:

Create a new database:

CREATE DATABASE wordpress_db;

Next, create a new MySQL user account for WordPress.

CREATE USER 'wordpress_user'@'localhost' IDENTIFIED BY 'password';

Replace wordpress_user and password with your desired username and password.

Grant the user privileges on the database.

GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wordpress_user'@'localhost';

Flush privileges to apply the changes.

FLUSH PRIVILEGES;

Exit out of the MySQL command prompt.

exit

Output:

root@server:~# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 41
Server version: 11.4.3-MariaDB-1 Ubuntu 25.10

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> CREATE DATABASE wordpress_db;
Query OK, 1 row affected (0.001 sec)

MariaDB [(none)]> CREATE USER 'wordpress_user'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.002 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wordpress_user'@'localhost';
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> exit
Bye

Download and Install WordPress

You can visit the official WordPress site to learn about the latest version and its server requirements.

Download the latest version of WordPress:

wget -O /tmp/wordpress.tar.gz https://wordpress.org/latest.tar.gz

Extract the downloaded file to the web directory.

tar -xzvf /tmp/wordpress.tar.gz -C /var/www/

Change ownership of the WordPress directory to the Nginx user:

chown -R www-data:www-data /var/www/wordpress

Configure Nginx for WordPress

Create a new Nginx configuration file:

nano /etc/nginx/conf.d/wordpress.conf

Add the following content:

server {
    listen 80;
    server_name your_domain.com;
    root /var/www/wordpress;

    index index.php index.html index.htm;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.4-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
        expires max;
        log_not_found off;
    }
}

Replace your_domain.com with your actual domain name or server IP.

Test the configuration and reload Nginx.

nginx -t
systemctl reload nginx

Configure WordPress

Open your browser and go to:

http://IP_ADDRESS/wordpress

Replace IP_ADDRESS with your server's actual IP. This will load the WordPress setup page.

Select your preferred language.

images

Click on Let’s go to proceed.

images

Enter the database details created earlier.

images

Click on Run the Installation.

images

Enter your site details and create a user for the admin dashboard.

images

Once installation completes, you’ll see a success message.

images

Login with your new credentials to access the WordPress dashboard, where you can configure your site as per your requirements.

images

images

This concludes our topic of installing WordPress on Ubuntu 25.10 using Nginx as a web server.


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