How to Install WordPress on Ubuntu 26.04 LTS Resolute Raccoon
In this step-by-step guide, we’ll see how to install WordPress on Ubuntu 26.04 LTS "Resolute Raccoon." First, we’ll install the L.A.M.P. stack—Apache2, MySQL, and PHP—on our Linux distribution, which will be used to host the CMS.
WordPress is an extremely popular open-source blogging platform used by millions of websites worldwide. Its ease of use, flexibility, and wide range of plugins and themes make it an ideal choice for both beginners and experts.
The L.A.M.P. stack—an acronym for Linux, Apache, MySQL, and PHP—is the most common foundation for web application development.
Installing WordPress on Ubuntu 26.04 LTS
Before you begin, make sure you have:
- An Ubuntu 26.04 LTS server connected to the Internet
- A username and password with privileges
sudoor accessroot - A registered domain (optional, but recommended for a public website)
Installing Apache2
Apache2 is an open-source web server that will serve WordPress files to your browser. Follow these steps to install it:
sudo apt update && sudo apt install apache2After installation, start and enable the Apache2 service:
sudo systemctl start apache2
sudo systemctl enable apache2Installing PHP 8.5
PHP is a server-side scripting language that WordPress uses to generate dynamic web pages. Install PHP 8.3 and the necessary modules:
sudo apt-get install php-pear libapache2-mod-php \
php8.5-{mysql,curl,gd,intl,mcrypt,ps,pspell,snmp,sqlite,tidy,xmlrpc,xsl}
sudo systemctl restart apache2Installing MariaDB
MariaDB is an open-source relational database that will be used to store WordPress data. Install MariaDB and start the service:
sudo apt install mariadb-server
sudo systemctl start mariadbOnce the installation is complete, run the following command to set a password for the MariaDB root user:
sudo mysql_secure_installationDownloading and Configuring WordPress 7
Using wget , download the latest version of WordPress to the directory /tmp
sudo apt install wget
cd /tmp
wget http://wordpress.org/latest.tar.gzUnzip the archive
tar -xf latest.tar.gzMove WordPress to the /var/www/html, which is the default directory for Apache2 web files.
sudo mv wordpress /var/www/html
sudo chown www-data:www-data /var/www/html -RCreating the database user and password
Create a new user and password to access the WordPress database; remember to replace "password" with a secure password and, if necessary, change the username and database name
sudo mysql -e "CREATE DATABASE wordpress;"sudo mysql -e "GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'%' IDENTIFIED BY 'password';"sudo mysql -e "SHOW databases;"The server will display the available databases, including the wordpress you just created
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| wordpress |
+--------------------+Let’s create a user for WordPress in the MySQL database
mysqlWelcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 37
Server version: 11.8.6-MariaDB-5 from Ubuntu -- Please help get to 10k stars at https://github.com/MariaDB/Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'password';Assign database permissions to the newly created user
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost';You have completed the basic command-line configuration
Complete the installation via the web interface
To finish installing WordPress on Ubuntu 26.04 LTS, open a web browser and access your server using its IP address or domain name, followed by /wordpress. For example http://IPWEBSERVER/wordpress. Follow the on-screen instructions to complete the WordPress installation, choosing your website name, username, and administrator password.
Need production support?
Contact us now! Get a free 30-minute analysis to optimize your system
. Rely on our dedicated Linux consulting services!