Here are the steps to install WordPress on Ubuntu Web Server
Create User and Database
First step is to create a new database for your WordPress website. First run MySQL as root.
sudo mysql -u root –p
You will be asked for the password. By default MySQL root user doesn’t have any password. So, just press Enter. That will let you enter MySQL Server.
Create a new MySQL Database
Create a new MySQL database for the WordPress
CREATE DATABASE database_name;
Create the User
Next thing we will do is create a user for the WordPress database and grant privileges for the user to use all tables of that database.
CREATE USER 'username'@'%' IDENTIFIED BY 'PasswordForUser';
GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'%';
Save All the Changes
Save all the changes by Flashing user privileges by following command.
Exit MySQL Database
Exit from MySQL Database by the following command and press Enter.
Download the latest version of WordPress and extract it to the /var/www/html directory.
curl -O https://wordpress.org/latest.tar.gz
tar xzvf latest.tar.gz
sudo mv wordpress/* /var/www/html/
In my case I want to install multiple WordPress on the same server, each WordPress on each directory. At this moment I’m going to install my site on the directory named roosho. So, I created a directory named roosho by following command.
Set Proper Permissions
Set the correct permissions on the WordPress files
sudo chown -R www-data:www-data /var/www/html
sudo chmod -R 755 /var/www/html
Again in my case, as I created the directory roosho. I’ve to change the permissions for the directory roosho.
sudo chown -R www-data:www-data /var/www/html/roosho
sudo chmod -R 755 /var/www/html/roosho
Begin WordPress Installation
Open a web browser and navigate to https://ip-address-of-ubuntu-web-server/ to begin the WordPress installation. In my case it is https://ip-address-of-ubuntu-web-server/roosho.
Complete the WordPress Installation
Rest are just typical. Follow the on-screen instructions to complete the installation and set up your WordPress website. When asked for the database use the username, database name and password that were used in the first step.
That’s it! Your WordPress website should now be up and running on the Nginx web server with PHP and MySQL.
In conclusion, setting up WordPress on Ubuntu Web Server is an exciting yet straightforward process if you follow the steps carefully. You are now ready to start building your website or blog in a development environment! With a few simple clicks and commands, you can have a powerful WordPress site running in no time. So, don’t let technical jargon scare you away from creating something great – start setting up WordPress on Ubuntu Web Server today and show off your creative ideas!