Install WordPress on Ubuntu 16.04 Desktop. Terminal commands to install WordPress on Ubuntu Localhost. Download the latest version of WordPress on Ubuntu and configure it. Please note that you need to install Apache or any other web server on your system to use WordPress. I assume you have installed and configured Apache web server on your system.
The first step is to download the latest wordpress. You can either download it manually or run the following commands to download it via Terminal:
sudo wget http://wordpress.org/latest.tar.gz
Once the package is downloaded, run the following command to extract WordPress package:
sudo tar -xvf latest.tar.gz
Now change directory to WordPress and copy all its contents to web directory /www/html
sudo cp -rRvf ~/wordpress/* /var/www/html
Now the most important part, create a database, its user and grant all the necessary privileges. To do so, run the following command:
mysql -u root -p
The next step is to configure database named ‘WORDPRESS’ and a user ‘USERNAME’. Once you have configured the database, change the directory to web /www/html and copy the WordPress configuration sample file to wp-config.php.
cd /var/www/html
cp wordpress/wp-config-sample.php wordpress/wp-config.php
When the WordPress configuration file opens, edit file and enter the Database Name, Database Username and Password. After you have entered all the credentials correctly, restart web service by running the following command:
# /etc/init.d/apache2 restart
Open your web browser and type 127.0.0.1/wp-admin/install.php
As soon as you type this, you will be able to see the WordPress configuration page. Simply follow the on-screen instructions and configure WordPress.