How to Install Wordpress 4.6.1 on Ubuntu 16.04
How to Install Wordpress 4.6.1 on Ubuntu 16.04
For this whole installation and configuration setup of Wordpress, the server must have a LAMP server installed as I described in this tutorial How To Install LAMP Stack On Ubuntu 16.04 Xenial Xerus before you proceed.
Now let's begin the process of installing Wordpress on Ubuntu 16.04 by following the easy steps. We will have user access as root privileges for the installation of WordPress.
Download WordPress 4.6.1
We will download Wordpress setup by following the mentioned command.
wget https://wordpress.org/latest.zip --2016-10-18 14:24:52-- https://wordpress.org/latest.zip Resolving wordpress.org (wordpress.org)... 126.96.36.199, 188.8.131.52 Connecting to wordpress.org (wordpress.org)|184.108.40.206|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 8650308 (8.2M) [application/zip] Saving to: ‘latest.zip’ latest.zip 100%[=====================================================================================>] 8.25M 335KB/s in 59s 2016-10-18 14:25:55 (143 KB/s) - ‘latest.zip’ saved [8650308/8650308]
After successfully downloaded the wordpress setup we will extract and place the code on following location:
unzip -q latest.zip -d /var/www/html/
Go to the below path and set the appropriate permissions for the directory.
cd /var/www/html/ chown -R www-data:www-data /var/www/html/wordpress; chmod -R 755 /var/www/html/wordpress
WordPress Database and User Creation
mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6 Server version: 5.7.13-0ubuntu0.16.04.2 (Ubuntu) Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
We will use the following command to create the database.
CREATE DATABASE wordpressweb; Query OK, 1 row affected (0.09 sec)
Now, create the new user and set password by following the steps outlined below.
CREATE USER wordpressuser@localhost; Query OK, 0 rows affected (0.28 sec) SET PASSWORD FOR wordpressuser@localhost= PASSWORD("p@ssw0rd"); Query OK, 0 rows affected, 1 warning (0.03 sec)
After database and user creation, we are going to grant all privileges to the user on Wordpress database with following command.
GRANT ALL PRIVILEGES ON wordpressweb.* TO wordpressuser@localhost; Query OK, 0 rows affected (0.03 sec)
We will refresh MySQL with below command and then exit from MySQL shell as follows.
FLUSH PRIVILEGES; Query OK, 0 rows affected (0.16 sec) exit
Restart the Apache and MySQL services.
systemctl restart apache2 systemctl restart mysql
Installation Steps of WordPress 4.6.1
After all above settings we are going to start web installation of Wordpress. Go to the URL
http://192.168.31.130/wordpress/ in your web browser. The WordPress installer will show up.
Select language and press Continue:
Wordpress Installer and Language Selection
Click on Let's go.
Language Selected and Lets Go
Type the Wordpress Database information which we created earlier. Then click on the "Submit" button.
Wordpress Database Information
Wordpress will save the DB configuration details to the file /var/www/html/wordpress/wp-config.php. Now proceed to "Run the install".
Save the Database Configuration
Now put the necessary information such as your Blog title, username, password and email.
Site Title: My WP Blog Email: firstname.lastname@example.org Username: admin Admin password: p@ssword
Then press Install Wordpress to complete the setup.
Title Username Password Email
Now press the Login button for further process.
Click on Login Button
Now type the credentials and press login.
Type Credentials and Press Login Button
Now showing up the WordPress Dashboard. You may start Blogging.
After successful installation we can see database configuration in command-line as shown below:
vim wordpress/wp-config.php // ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', 'wordpressweb'); /** MySQL database username */ define('DB_USER', 'wordpressuser'); /** MySQL database password */ define('DB_PASSWORD', 'p@ssw0rd'); /** MySQL hostname */ define('DB_HOST', 'localhost'); /** Database Charset to use in creating database tables. */ define('DB_CHARSET', 'utf8mb4'); /** The Database Collate type. Don't change this if in doubt. */ define('DB_COLLATE', '');
Now you have installed Wordpress 4.6.1 on your Ubuntu server. You may start blogging.