How To Install WordPress 6.0 On Ubuntu 22.045 min read
In this tutorial how to install WordPress 6.0 on Ubuntu 22.04 server. WordPress is an open source content management system written by php and mysql.
############################# My server info : Server IP : 10.66.10.5 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 && ip r [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
Reset mysql root password using below command.
[email protected]:~# mysql_secure_installation
Step #02: Install php7.4.
[email protected]:~# add-apt-repository -y ppa:ondrej/php [email protected]:~# apt update
Then run all required php extension as like below.
[email protected]:~# apt install libapache2-mod-php7.4 php7.4-mbstring php7.4-cli php7.4-mysql php7.4-cgi php7.4-fpm php7.4-gd php7.4-imap php7.4-xml php7.4-intl php-dev libmcrypt-dev php-pear php-apcu unzip -y
Check your server php is working. Create one php file or open
[email protected]:~# vi /var/www/html/tech.php
Insert below line into tech.php file.
<?php phpinfo(); ?> //PHP code goes here
Then browse your server ip address as like below.
http://10.66.10.5/tech.php
Step #03: Download latest WordPress using wget command.
[email protected]:~# wget -c http://wordpress.org/latest.tar.gz [email protected]:~# tar -xzvf latest.tar.gz
Then move all file into html default root directory.
[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 WordPress Database and user permission.
[email protected]:~# mysql -u root -p
Then type your mysql root user password.
create database wp_db; grant all privileges on wp_db.* to 'wp_db_user'@'localhost' identified by 'wp_db_passw0rd'; flush privileges; \q
Copy wp-config.php file from default name.
[email protected]:~# mv /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
Open this file and insert database name, user name and password.
[email protected]:~# vi /var/www/html/wp-config.php
Inset into this file.
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 mysql service.
[email protected]:~# systemctl restart apache2.service [email protected]:~# systemctl restart mariadb.service
Step #05: Configure web config file.
Open default config file using any editor.
[email protected]:~# vi /etc/apache2/sites-available/000-default.conf
Insert below all line and replace as your server ip address.
ServerAdmin [email protected] DocumentRoot /var/www/html ServerName server_domain_name_or_IP AllowOverride All ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined
Step #06: Setup permission and enable rewrite rule.
[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
Then browse your server ip address for web installation process.
http://10.66.10.5/
If you see any error so please see my YouTube video for more help.
- How To Install Odoo 16 on Ubuntu 22.04 - May 14, 2023
- 12 Steps to Organize Photos on Your Computer - March 20, 2023
- 9 Ways to Speed Up Your MacBook Yosemite - February 21, 2023
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!