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.
root@WordPress:~# lsb_release -a root@WordPress:~# ip r
Step #02: Server update & install web server and database.
root@WordPress:~# apt-get update && apt-get upgrade -y root@WordPress:~# apt-get install apache2 apache2-utils -y root@WordPress:~# systemctl enable apache2 root@WordPress:~# systemctl start apache2 root@WordPress:~# apt install mariadb-server -y root@WordPress:~# systemctl enable mariadb root@WordPress:~# systemctl start mariadb root@WordPress:~# 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.
root@WordPress:~# apt-get install php7.4 php7.4-mysql libapache2-mod-php7.4 php7.4-cli php7.4-cgi php7.4-gd -y root@WordPress:~# 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.
root@WordPress:~# wget -c http://wordpress.org/latest.tar.gz root@WordPress:~# tar -xzvf latest.tar.gz root@WordPress:~# rsync -av wordpress/* /var/www/html/ root@WordPress:~# chmod -R 755 /var/www/html/ root@WordPress:~# chown -R www-data:www-data /var/www/html/ root@WordPress:~# rm -rf /var/www/html/index.html
Step #04: Create database for install WordPress.
root@WordPress:~# 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.
root@WordPress:~# mv /var/www/html/wp-config-sample.php /var/www/html/wp-config.php root@WordPress:~# 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.
root@WordPress:~# systemctl restart apache2.service root@WordPress:~# systemctl restart mariadb.service root@WordPress:~# vi /etc/apache2/sites-available/000-default.conf
Like example below
<VirtualHost *:80> ServerAdmin webmaster@localhost 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.
root@WordPress:~# a2enmod rewrite root@WordPress:~# systemctl restart apache2 root@WordPress:~# touch /var/www/html/.htaccess root@WordPress:~# chown :www-data /var/www/html/.htaccess root@WordPress:~# chmod 664 /var/www/html/.htaccess root@WordPress:~# 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.
- How To Install Zabbix Server 6.4 On AlmaLinux 8 Server - August 9, 2024
- How To Clear RAM Memory Cache Buffer Linux Server - February 29, 2024
- How To Install Apache Cloud Stack Management Server 4.17 On Ubuntu 22.04 - February 1, 2024
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!