Install WordPress website

This post is part of my Your own Virtual Private Server hosting solution project.
Get the latest version of this article here:


WordPress is web software you can use to create a beautiful website or blog.



Create the website directory

sudo mkdir /var/www/[wordpress]/

Open the WordPress site directory

cd /var/www/[wordpress]/

Download latest WordPress package and untar it

sudo wget
sudo tar -xzvf latest.tar.gz

Copy the untared files to the current folder and delete the other files

sudo cp -r ./wordpress/* ./
sudo rm -r wordpress
sudo rm latest.tar.gz

Let’s create the MySQL WordPress database and user.

mysql -u root -p

Enter the MySQL root user password.

Create the WordPress database.

CREATE DATABASE [wordpress];

Create the WordPress database user.

CREATE USER [wordpress]@localhost;

Set the password for the WordPress database user.

SET PASSWORD FOR [wordpress]@localhost = PASSWORD("[password]");

Grant WordPress user full access on WordPress database.

GRANT ALL PRIVILEGES ON [wordpress].* TO [wordpress]@localhost IDENTIFIED BY '[password]';

Refresh MySQL and exit.


Add the Nginx configuration to the WordPress website.


  location / {
    try_files $uri $uri/ /index.php?$args;

Update permissions for the www-data group.

sudo chown www-data:www-data /var/www/[wordpress] -R 

Test config and reload Nginx service.

sudo nginx -t && sudo service nginx reload

Open the browser again on //[host] and install the WordPress blog.


WordPress Nginx Codex
How To Install WordPress with nginx on Ubuntu 12.04 by Digital Ocean

Leave a Reply

Back to Top
%d bloggers like this: