Backend Development 5 min read

Step‑by‑Step Guide to Deploying WordPress on a Linux Server with Nginx, PHP, and MySQL

This tutorial walks through downloading WordPress, extracting the package, creating a MySQL database and user, configuring wp‑config.php, setting up Nginx, and testing the installation to get a fully functional WordPress site running on a Linux server.

Practical DevOps Architecture
Practical DevOps Architecture
Practical DevOps Architecture
Step‑by‑Step Guide to Deploying WordPress on a Linux Server with Nginx, PHP, and MySQL

WordPress is a PHP‑based blogging platform that can also serve as a content management system (CMS) on servers that support PHP and MySQL.

The article explains how to deploy WordPress on a Linux server.

Download the latest Chinese package from the official site: https://cn.wordpress.org/ .

2.1 Extract the package

cd /home/www tar -xzvf wordpress-4.8-zh_CN.tar.gz

2.2 Create the database and user

In MySQL (or via phpMyAdmin) create a database named wordpress and grant privileges to a user:

mysql> create database wordpress; mysql> grant all on wordpress.* to wordpress@'192.168.137.%' identified by "123456"; flush privileges;

2.3 Configure WordPress

Copy the files to the web root and edit wp-config.php :

cp -rp wordpress/* /home/www/ cp /home/www/wp-config-sample.php /home/www/wp-config.php vim /home/www/wp-config.php

Set the database constants:

define('DB_NAME','wordpress'); define('DB_USER','wordpress'); define('DB_PASSWORD','123456'); define('DB_HOST','192.168.137.133');

Adjust directory permissions as needed.

Nginx configuration (excerpt)

user nginx nginx; worker_processes 1; worker_rlimit_nofile 65535; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name localhost; location / { root /home/www; index index.php index.html index.htm; } location ~ \.php$ { root /home/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } }

4. Test the installation

Open http://192.168.137.133/index.php in a browser, complete the setup wizard (site name, admin user, password, email, etc.), and then access the admin dashboard at http://192.168.137.133/wp-admin/ . The personal site can be viewed at http://172.18.50.75/ .

DeploymentMySQLPHPnginxWordPress
Practical DevOps Architecture
Written by

Practical DevOps Architecture

Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.