How to Install WordPress in Ubuntu 24.04 LTS Noble Numbat
In this step-by-step guide, we see how to install WordPress in Ubuntu 24.04 LTS "Noble Numbat". We first install the L.A.M.P. Apache2, MySQL and PHP stack on our Linux distribution that will serve 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 beginners and experts alike.
The L.A.M.P. stack, an acronym for Linux, Apache, MySQL, PHP, is the most common as the basis for web application development.
Installing WordPress in Ubuntu 24.04 LTS
Before you get started, make sure you have:
- An Ubuntu 24 server.04 LTS connected to the Internet
- A username and password with
sudo
privileges orroot
access - 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 apache2
After installation, start and enable Apache2 service:
sudo systemctl start apache2
sudo systemctl enable apache2
Installing PHP 8.3
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.3-{mysql,curl,gd,intl,imap,mcrypt,ps,pspell,snmp,sqlite,tidy,xmlrpc,xsl}
sudo systemctl restart apache2
Installing 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 mariadb
When installation is complete, run the following command to set a password for the MariaDB root user:
sudo mysql_secure_installation
Downloading and configuring WordPress
Using wget
download the latest version of WordPress in the /tmp
sudo apt install wget
cd /tmp
wget http://wordpress.org/latest.tar.gz
Decompress the archive
tar -xf latest.tar.gz
Move WordPress to the /var/www/html
directory, default for Apache2 web files.
sudo mv wordpress /var/www/html
sudo chown www-data:www-data /var/www/html -R
Create database user and password
Create a new user and password for accessing the WordPress database, remember to replace "password" with a secure password and possibly change the username and database
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 show us the databases present, including the newly created wordpress
DB
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| wordpress |
+--------------------+
Complete Installation via Web Interface
To finish Installing WordPress in Ubuntu 24.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 the website name, username and administrator password.
Support in production?
Contact Us Now! Free 30m Analysis to Optimize Your System
Rely on our Dedicated Linux Consulting!