How to Install WordPress with LAMP on Ubuntu 26.04

WordPress is one of the most popular website-building tools available. It is a simple way to build your online presence, especially for users who prefer not to code.

Prerequisites

Creating Database

Log into MySQL/MariaDB:

mysql -u root -p

Inside the MySQL shell, run:

CREATE DATABASE wordpress_db;

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

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

FLUSH PRIVILEGES;

exit

Output:

root@vps:~# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.
Server version: 11.x MariaDB

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

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

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

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

MariaDB [(none)]> exit
Bye

Download and Install WordPress

Download latest WordPress:

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

Extract files:

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

Set permissions:

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

Configure WordPress

Open your browser and visit:

http://IP_ADDRESS/wordpress

Replace IP_ADDRESS with your server IP.

Follow the setup steps:

  • Select language

images

  • Click Let's go

images

  • Enter database details:

images

- Database Name: wordpress_db
- Username: wordpress_user
- Password: password
- Host: localhost

Click Run the Installation

images

Then:

images

  • Enter site name
  • Create admin user & password
  • Complete setup

images

After installation, login to:

http://IP_ADDRESS/wordpress/wp-admin

images

You will be redirected to the WordPress dashboard where you can manage your website.

images

🎉 WordPress has been successfully installed on Ubuntu 26.04 with LAMP.


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