How To Install WordPress on Ubuntu 20.04
Author: Kenneth ([email protected])
Published: Tuesday March 23, 2021
What is Ubuntu?
Ubuntu is a Linux based operating system. It is designed for smartphones, computers, and network servers. The system has been developed by a UK-based company called Canonical Limited, based on all the principles used to develop Ubuntu software and the principles of open source software development.
What is WordPress?
WordPress is the most popular CMS. It is based on PHP and MySQL. The features of WordPress extended with millions of free plugins and themes.
Lets Get Coding
Let us install all dependencies and WordPress itself.
apt update apt install php libapache2-mod-php mysql-server php-mysql cd /var/www/ wget https://wordpress.org/latest.tar.gz tar -xzvf latest.tar cp wp-config-sample.php wp-config.php
Configure MySQL Database
Now, log into the MySQL root (administrative) mysql command, then the following statements.
mysql -u root -p; CREATE DATABASE wordpress; CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'password'; GRANT ALL ON *.* TO 'wordpress'@'localhost';
Now, let’s configure WordPress to use this database. Use nano to open
define('DB_NAME', 'wordpress'); define('DB_USER', 'wordpress'); define('DB_PASSWORD', 'password'); define('DB_HOST', 'localhost');
Configure Apache for WordPress
/etc/apache2/sites-available/000-default.conf by changing the following:
Enable URL rewriting with
a2enmod rewrite and reload apache2 with
service apache2 reload.
your IP Address in your browser. You will be asked for title of your new site, username, password and address e-mail. You can choose if you want to make your site indexed by search engines. You can now login under
This solution requires you to have root access. So we recommend choosing a host with one. We recommend DigitalOcean.