How to Install WordPress Using Nginx on Ubuntu Server

As the world’s most popular CMS platform, WordPress gives you the freedom to install it on various operating systems, one of which is Ubuntu Server. For those of you who use Ubuntu VPS, you can install WordPress with Nginx.

Nginx is a web server known for its fast, efficient performance and ability to handle high traffic. Therefore, installing WordPress on Ubuntu with Nginx is the right choice to improve your site’s performance.

This article will explain how to install WordPress on Ubuntu with Nginx, from setting up a VPS server to running a WordPress site on Ubuntu. Don’t worry, because this guide can be applied to Ubuntu 18.04, 20.04, and 22.04.

Here is the complete tutorial for you!

What Do You Need to Prepare?
To be able to practice how to install WordPress on a VPS , especially on Ubuntu, you need to prepare the following things:

Linux VPS Service – You need to subscribe to a Linux-based Virtual Private Server (VPS) from a VPS service provider.
Ubuntu Operating System – Make sure your VPS has one of the compatible Ubuntu versions installed, such as Ubuntu 18.04, 20.04, and 22.04.
Web Server – To avoid conflicts, make sure that no web servers other than Nginx are installed on your Ubuntu Server.
For those of you who do not have a VPS, you can subscribe to VPS Hosting from Niagahoster . This service provides a variety of Linux operating system options that you can install, including Ubuntu.

The first thing you need to do is update the Ubuntu repositories. By updating the repositories, you can ensure that Ubuntu is using the latest and safest versions of software packages.

To do so, please login to Ubuntu Server using SSH . After that, follow these steps:

Run the command below in the Terminal window :

sudo apt updateContinue by executing the following command:sudo apt upgradeAfter that, you will see a display like the one below:update ubuntu repositoryView after successfully updating Ubuntu repositoryStep 2: Install NginxAfter updating the Ubuntu repository, the next step is to install the Nginx web server on Ubuntu. Nginx will be the main web server that handles HTTP requests for your WordPress website.Here’s how to install Nginx on Ubuntu 20.04:Run the following command to start the Nginx installation:sudo apt install nginx
Please wait for the installation process to complete.
f so, the output that appears on the screen will be something like this:
install nginx
View after successfully installing Nginx on Ubuntu Server
Next, enable Nginx with the two commands below:
sudo systemctl start nginx
sudo systemctl enable nginx
To ensure that Nginx is truly active, you can write this command:
sudo systemctl status nginx
make sure nginx web server is active on ubuntu
Nginx web server is up and running on Ubuntu Server
Step 3: Install and Configure MySQL
In the third step, you will install a MySQL database to store all your WordPress site data. In addition, you will also configure some basic security settings for MySQL.

Here are the steps:

To start installing MySQL, run the europe cell phone number list following command:sudo apt install mysql-server
You will see the screen below indicating the MySQL installation was successful:
install mysql
MySQL successfully installed on Ubuntu Server
Enter the MySQL shell by running this command:
mysql -u root -p
Now, it’s time to create a MySQL database for WordPress. Run the following command to name the database wordpress (you can replace it with another name if you want):
CREATE DATABASE wordpress;
Next, create a new user and set a password for WordPress database access. Execute this command and change the username and new password to your liking:

Give the appropriate access rights to the user you just created. Run the following command:
GRANT ALL PRIVILEGES ON wordpress.* TO ‘nama_user’@’localhost’;
To apply the access rights changes, type this one command:
FLUSH PRIVILEGES;
set database access rights
Setting database permissions for users
Once the database configuration is complete, exit the MySQL shell by typing:
exit;
Step 4: Install PHP and its Extensions
How to install WordPress using Nginx on Ubuntu 20.04 continues by installing the PHP programming language and its extensions. This is necessary so that your WordPress site can run smoothly on the server.

PHP can be installed by following the steps below:

europe cell phone number list

Start by executing the following command:
sudo apt install php-fpm php-mysql
Please wait until the PHP extension installation process is complete.
After successful installation, you will see the following display:
install php
Installing PHP and its yadda ake tabbatar an buga sanarwar jarida na? extensions on UbuntuTo ensure PHP is installed correctly, you can verify theinstalled PHP version with the following command:php -vThe output will display the PHP version installed on the server.check installed php versionView the PHP version installed on Ubuntu Server
tep 5: Install WordPress with Nginx
At this point, you have set up a basic development environment for WordPress. Next, you can download the WordPress package from the official site and install it via Nginx.

Follow these WordPress installation instructions:

To get started, go to thtml directory with th be numbers download the WordPress package file using l view that appears before you will look something like  files in how to install on ubuntu with package file from the official ce the WordPress package files are downloaded, extract them using this co tar -xly, set the file permissions so that it can be accessed s-R www- files and set permissions for 6: Configure Virtual Host in Nginx, you need to create a virtual host so that the WordPress site can connect to the Nginx web server. For those of you who already have a domain or not, this step is one you should not miss.

How to create a virtual host on Ubuntu with Nginx is as follows:

Leave a Comment

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

Scroll to Top