Installing WordPress 4.7 on Ubuntu 16.10 Server

installing magento on ubuntu

WordPress 4.7 was recently released and this brief tutorial is going to show students and new users how to quickly install and configure it on a Ubuntu 16.10 server. As was every version of WordPress the standard configuration process remains the same.

WordPress depends on the LAMP stack to function. The LAMP stack is an acronym for Linux, Apache2, MySQL and PHP. Without LAMP, WordPress won’t function. So, to get started, continue below with installing WordPress.

Step 1: Installing the LAMP Stack

Before you can install and use websites based WordPress your first task will be installing LAMP. We’re assuming you already have Ubuntu server installed and configured. If so, continue below to install and configure the rest of the stack. The other components can be installed using the link below:

Step 2: Creating WordPress and User

After installing LAMP using the link above, go and create WordPress database and user. WordPress uses database to store its content and the user establishes connection between WordPress content and the database. To do that, run the commands below to logon to the database.

mysql -u root -p

Then run the commands below to create a database called wpdb.


Next run the commands below to create a database user called wpuser and grant the user access to manage the wpdb database

GRANT ALL ON wpdb.* TO 'wpuser'@'locahhost' IDENTIFIED BY 'new_password_here';

Finally, save the changes and exit.


Step 3: Download and Configure WordPress

Now that WordPress database and user are created, go and download WordPress latest content. To do that, run the commands below

cd /tmp/ && wget

Next, extract the downloaded content and copy it to Apache2 default root directory on Ubuntu.

tar -xzvf latest.tar.gz
sudo cp -R wordpress/* /var/www/html

Next, remove Apache2 default index.html test file from its root directory. This can cause issues for new users.

sudo rm -rf /var/www/html/index.html

After that, create WordPress configuration file from its sample file by running the commands below.

sudo cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php

Then open wp-config.php file and make the following highlighted changes to reference the database and user you created above.

sudo nano /var/www/html/wp-config.php

When the file opens, make the changes and save.

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wpdb');

/** MySQL database username */
define('DB_USER', 'wpuser');

/** MySQL database password */
define('DB_PASSWORD', 'new_password_here');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

Step 4: Change WordPress content file permissions

After configuring WordPress settings, you next step will be to change Apache2 directory permissions so WordPress can function properly. To do that, run the below commands

sudo chown -R www-data:www-data /var/www/html/
sudo chmod -R 755 /var/www/html/

Finally, restart Apache2 webserver and open your browser and go to the server IP address or hostname.

sudo systemctl restart apache2

Open your browser and go to the server hostname and you should see WordPress default setup page.

Continue with WordPress wizard to setup your new site.

WordPress default setup page

That’s it! This is how to install WordPress 4.7 on Ubuntu 16.10 server.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.