How To Install WordPress On Ubuntu 20.047 min read
Now I want to share how to install WordPress on ubuntu 20.04 server. WordPress is an most popular opensource CMS. You can install on your vps or local server using my tutorial.
★ How To Install Zabbix 5.0 On Centos 7
★ How To Install DNS Server (Bind9) On Ubuntu 20.04
My server info :
Server IP : 10.66.11.15
Disk : 25 GB
RAM : 1GB
vCPU : 2
Service : WordPress
Web : Apache
Database : Mariadb
Php : 7.4
Step #01: Check server version and ip address.
[email protected]:~# lsb_release -a [email protected]:~# ip r
Step #02: Server update & install web server and database.
[email protected]:~# apt-get update && apt-get upgrade -y [email protected]:~# apt-get install apache2 apache2-utils -y [email protected]:~# systemctl enable apache2 [email protected]:~# systemctl start apache2 [email protected]:~# apt install mariadb-server -y [email protected]:~# systemctl enable mariadb [email protected]:~# systemctl start mariadb [email protected]:~# mysql_secure_installation
Press y| Y << Type Y press enter
Do you want to continue press y|Y << Type Y press enter
Remove anonymous user press y|Y << Remove anonymous user type Y press enter
Disallow root login remoetly y|Y << Disallow root user login type Y press enter
Remove test database and access to it y|Y << Remove test database type Y press enter
Reload privilege tables now? y|Y << Reload all tables type Y press enter
Step #03: Install php and check properly working.
[email protected]:~# apt-get install php7.4 php7.4-mysql libapache2-mod-php7.4 php7.4-cli php7.4-cgi php7.4-gd -y [email protected]:~# vi /var/www/html/tech.php
Insert below code into tech.php file.
<?php phpinfo(); ?> //PHP code goes here
Browse your server ip address with file name tech.php
http://10.66.11.15/tech.php
Step #04: Download latest WordPress and setup permission.
[email protected]:~# wget -c http://wordpress.org/latest.tar.gz [email protected]:~# tar -xzvf latest.tar.gz [email protected]:~# rsync -av wordpress/* /var/www/html/ [email protected]:~# chmod -R 755 /var/www/html/ [email protected]:~# chown -R www-data:www-data /var/www/html/ [email protected]:~# rm -rf /var/www/html/index.html
Step #04: Create database for install WordPress.
[email protected]:~# mysql -u root -p
If you not setup mysql root password from step #2 last command. So it is default password is blank.
MariaDB [(none)]> create database wp_db; MariaDB [(none)]> grant all privileges on wp_db.* to 'wp_db_user'@'localhost' identified by 'wp_db_passw0rd'; MariaDB [(none)]> flush privileges; MariaDB [(none)]> \q
Step #05: Create wp-config.php file from original file.
[email protected]:~# mv /var/www/html/wp-config-sample.php /var/www/html/wp-config.php [email protected]:~# vi /var/www/html/wp-config.php
Now insert below details already created from Step #4.
define('DB_NAME', 'wp_db'); define('DB_USER', 'wp_db_user'); define('DB_PASSWORD', 'wp_db_passw0rd'); define('DB_HOST', 'localhost'); define('DB_CHARSET', 'utf8'); define('DB_COLLATE', '');
Restart apache and mariadb server and check default vHost file is ok.
[email protected]:~# systemctl restart apache2.service [email protected]:~# systemctl restart mariadb.service [email protected]:~# vi /etc/apache2/sites-available/000-default.conf
Like example below
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html ServerName server_domain_name_or_IP <Directory /var/www/html/> AllowOverride All </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Step #06: Rewrite enable and create htaccess file and setup permission.
[email protected]:~# a2enmod rewrite [email protected]:~# systemctl restart apache2 [email protected]:~# touch /var/www/html/.htaccess [email protected]:~# chown :www-data /var/www/html/.htaccess [email protected]:~# chmod 664 /var/www/html/.htaccess [email protected]:~# service apache2 restart
Now browse your server ip address and complete installation process.
http://10.66.11.15/
Then click Continue and type site title, Username, Password and Your Email. Now click Install WordPress.
If all is ok so you see Success!
WordPress has been installed. Thank you and enjoy!
For more details see my YouTube video.
- 9 Ways to Speed Up Your MacBook Yosemite - February 21, 2023
- How To Install GitLab CE on Ubuntu 22.04 - December 15, 2022
- 7 Things to Know About Laptop Internet Cards - October 26, 2022
We really appreciate for your support for buying me a coffee.
It takes us a while to compose and upload new content, as they have to be checked to see if Properly works. We appreciate you if you help me for one cup of coffee to keep us awake and always deliver good quality content.
No contribution is small of an amount. We are grateful for any amount you support us with. Thank you!
Thanks a lot its work!!
Most welcome!