HOWTO: Install WordPress on Nginx

Assuming you already have Nginx and FastCGI configured, setting up WordPress is a snap.

Download WordPress to your document root:


Extract the WordPress package:


Rename WordPress’s configuration file:

root@warzone:/#mv wp-config-sample.php wp-config.php

Edit the wp-config.php file and add your database info:

root@warzone:/#nano -w wp-config.php

File excerpt: wp-config.php

/** The name of the database for WordPress */
define('DB_NAME', 'database_name');

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

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

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

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

Check your Nginx Configuration:

The file you need to edit is called “nginx.conf” and is installed in different locations depending on your Linux distribution. If you install Nginx from source, the default location is /usr/local/nginx/conf/nginx.conf, however it may be somewhere else like /etc/nginx/conf/nginx.conf or /etc/nginx/nginx.conf.

Since we are assuming you already have Nginx up and running, you just need to check your try_files line:

try_files $uri $uri/ /index.php;

Then all that’s left it to install WordPress from the web interface:

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
HOWTO: Install WordPress on Nginx, 5.0 out of 5 based on 1 rating

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>