WordPress is a powerful blogging platform for everyone. WordPress is very easy to use, powerful and has many features you need for a dynamic blog or websites. If you have your own server, you can install and run your WordPress powered website on the server with few simple steps. On this tutorial, I will guide you to install WordPress on Ubuntu 16.04 server. For your information, I install WordPress on my cloud computing (Droplet) hosted in DigitalOcean server. DigitalOcean is has some good service on cloud computing at an affordable price with a simple pricing (compared to Amazon EC2).
Step to install WordPress on Ubuntu 16.04 Server
WordPress needs a working web server with database backend on the server. Before following the tutorial on this post, make sure you have a working web server on Ubuntu 16.04. Please have a look at my previous tutorial on how to install LAMP Server on Ubuntu 16.04.
After you have a working web server, now we can start installing WordPress on Ubuntu 16.04 Server.
Step 1. Create a new database and user
We need to create a new MySQL database and new database user that will be used for WordPress. Log in to the server and create a new database. For example, wpdatabase will be used as the new database name, and wpuser will be used as the new database user.
mysql -u root -p create database wpdatabase; create user wpuser@localhost identified by '1234567'; grant all privileges on wpdatabase.* to wpuser@localhost; flush privileges; exit
2. Install WordPress We need to download the latest WordPress package from the official website. The version may vary. At the time this post is being written, WordPress version is 4.5.3. Use wget to download the latest WordPress.
Now we need to extract the package and move the wordpress directory to /var/www/html/
tar -xzvf latest.tar.gz mv wordpress /var/www/html/
Change the permission
chmod -R 755 /var/www/html/wordpress
Create uploads directory under wp-content
Now change the group ownership so the web server can write to the uploads directory we created above.
chown -R www-data:www-data /var/www/html/wordpress/wp-content/uploads
Done. Now, we can continue configure WordPress via web browser. Open Google Chrome or other web browser and type your server IP address with the following format:
You will see the following page appear. You will be asked for the database credentials we created on the first step of this tutorial. Press Lets go to continue. Then enter the database and user credential we created previously Press Submit to continue. On the next step, you will see the following error displayed on the screen.
The error above means that we don’t have the correct wp-config.php yet. So we need to create a new one. Open Terminal and use this command to create a new wp-config.php file under /var/www/html/wordpress/
Then paste the content from the above text into the newly created wp-config file.php. And the click Run the Install button. It should works now.
Congratulations, our new WordPress website is now installed. We will need to create a new credentials to access the WordPress dashboard as follow. Thanks for reading this short tutorial how to install WordPress on Ubuntu 16.04. See you on the next tutorial.