You are currently viewing How to install WordPress in Ubuntu 16.04

How to install WordPress in Ubuntu 16.04

1. Update the system packages:

$ sudo apt-get update 

2. Install Apache web server:

$ sudo apt-get install apache2 

3. Install MySQL database server:

$ sudo apt-get install mysql-server 

4. Install PHP:

$ sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql 

5. Enable the mod_rewrite module:

$ sudo a2enmod rewrite 

6. Restart Apache:

$ sudo systemctl restart apache2 

7. Download the WordPress package:

$ wget 

8. Extract the downloaded package:

$ tar -xzvf latest.tar.gz 

9. Create a new MySQL database for WordPress:

$ sudo mysql -u root -p 

10. Create a new MySQL user and password:

CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'password'; 

11. Grant privileges to the new user for the WordPress database:

GRANT ALL PRIVILEGES ON *.* TO 'wordpressuser'@'localhost'; 

12. Flush privileges:


13. Exit the MySQL console:


14. Copy the WordPress files to the document root directory:

$ sudo cp -r wordpress/* /var/www/html/ 

15. Create a WordPress configuration file:

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

16. Set the proper permissions for WordPress:

$ sudo chown -R www-data:www-data /var/www/html/ 

17. Configure the WordPress configuration file with the correct database information:

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

18. Restart Apache web server:

$ sudo systemctl restart apache2 

19. Access the WordPress installation wizard in a web browser:


Leave a Reply