WordPress is a widely used CMS (Content Management System) application, which is based on PHP and MySQL. It is the most popular and the simplest way of creating a website or a blog.
The guide outlines the basic steps of installing WordPress application in an Ubuntu server, assuming that the server already has a web service (Apache), database service (MySQL/MariaDB) and PHP installed in it.
The first step before installing WordPress on the server would be to create a database that would be used to store the WordPress data.
For installing WordPress, the latest WordPress installation archive file first needs to be downloaded. This can be done from the official WordPress downloads page https://wordpress.org/download/.
Navigate to the path under which the WordPress application is to be installed. This can be under the default document root of the web service or under any website.
In the below example, WordPress is being installed under the default document directory of Apache /var/www/html/
.
# cd /var/www/html/
Download the latest WordPress installation archive file.
# wget https://wordpress.org/latest.tar.gz
Extract the tarball latest.tar.gz
, which will create a folder named “WordPress” containing the installation files.
# tar -xvf latest.tar.gz
Update ownership of the WordPress folder and all files inside it.
# chown -R www-data:www-data /var/www/html/wordpress
Here, www-data
is the user that the Apache webserver runs as. If WordPress is being installed under a website, then the owner needs to be updated using the username associated with the website.
Execute below two commands to set the required permissions for the wordpress
folder and files and folders inside it.
# find /var/www/html/wordpress/ -type d -exec chmod 755 {} \;
# find /var/www/html/wordpress/ -type f -exec chmod 644 {} \;
The WordPress installation page can now be browsed using a browser.
http://ipaddress/wordpress (if wordpress installed under default directory)
(or)
http://websitename/wordpress (if wordpress installed under a website)
Select the preferred installation language and click on Let’s go!
on the next page to continue with the WordPress installation wizard.
On the next page, fill in the details of the database that was created earlier. The WordPress default data would be loaded into this database. The Database Host
and Table Prefix
fields can be left changed.
Click on Run the installation
to proceed
Type in additional details required such as Site Title, Username, Password
and Email address
. Make sure that a strong password is used and the user credentials are saved safely. Once all details are filled in, scroll down and click on Install WordPress
.
Once the installation has been completed, a Success!
notification will be shown.
Click on the Login
button to access the login page of WordPress. Type in the user credentials to access the WordPress dashboard, which can be used to further develop the website.