Install WordPress On Nginx Ubuntu
Introduction
WordPress is a popular open-source blogging platform and content management system (CMS). It is made to be used on the internet, and it is the most widely used blogging platform. It is easy to install, and there are many options available for users to customize their sites. In this tutorial, we will show you how to install WordPress on an Ubuntu system running the Nginx web server.
Prerequisites
Before you begin, you will need to have the following:
- Ubuntu 18.04 server with a non-root user with sudo privileges.
- Nginx web server.
- MySQL or MariaDB to store the WordPress data.
- PHP installed and configured.
Installing Nginx
The first step is to install Nginx. Nginx is a popular web server that is fast and reliable. To install Nginx, open a terminal and type the following command:
sudo apt-get install nginx
Once the installation is complete, start the Nginx service with the command:
sudo systemctl start nginx
You can also enable the Nginx service so that it starts automatically when the system boots:
sudo systemctl enable nginx
Installing MySQL/MariaDB
Next, we need to install MySQL or MariaDB. These two database systems are compatible with WordPress and will work perfectly. To install MySQL/MariaDB, type the following command:
sudo apt-get install mysql-server
You will be asked to enter a password for the MySQL root user. Enter a secure password, confirm it, and execute the command.
Once the installation is complete, start the database server with the command:
sudo systemctl start mysql
Installing PHP
Once the database server is up and running, we need to install PHP. WordPress requires a few PHP plugins in order to work, so we will install all required plugins. To do this, execute the following command:
sudo apt-get install php-fpm php-mysql
This command will install all the necessary plugins for WordPress. Once the installation is complete, you can check if it was successful by typing the following command:
php -v
This command will output the PHP version number. If you get a version number, then PHP was installed successfully.
We also need to configure Nginx to use PHP. To do this, edit the Nginx configuration file with the command:
sudo nano /etc/nginx/sites-available/default
In this file, replace the line:
index index.html index.htm
With the following line:
index index.php index.html index.htm
And then add the following lines at the end of the file:
location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
Save and close the file, then restart Nginx with the command:
sudo systemctl restart nginx
Download and Install WordPress
Now, we are ready to install WordPress. We will download the latest version of WordPress from the official website. To do this, open a terminal and type the following command:
curl -O https://wordpress.org/latest.tar.gz
This will download WordPress in the current directory. Next, extract the contents of the archive with the command:
tar xzvf latest.tar.gz
This will extract the contents of the archive into a directory called ‘wordpress’.
We need to configure the WordPress directory so that the web server can access it. To do this, move the contents of the WordPress directory to the web server’s document root directory. To do this, type the following command:
sudo mv worpdpress/ /var/www/html/
The final step in the installation process is to create a MySQL database for WordPress. To do this, log in to the MySQL console with the following command:
sudo mysql -u root -p
Enter the MySQL root password when prompted. Once you are logged in, type the following command to create the WordPress database:
CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
Next, create a MySQL user that will be used by WordPress with the command:
CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'password';
Replace ‘wordpressuser’ and ‘password’ with different values. Next, grant the user permissions with the command:
GRANT ALL ON wordpress.* TO 'wordpressuser'@'localhost';
Finally, flush the privileges with the command:
FLUSH PRIVILEGES;
Exit the MySQL console with the command:
EXIT;
Running the WordPress Installation Script
Now, we are ready to run the WordPress installation script. To do this, open your web browser and go to:
http://your_ip_address/wordpress/wp-admin/install.php
You will be taken to the WordPress installation page. Enter your site title, username, password, and email address. When you are finished, click the Install WordPress button at the bottom of the page.
When the installation is complete, log in to the WordPress dashboard with the username and password you specified. You can now start setting up your website and adding content.
Conclusion
In this tutorial, we have shown you how to install WordPress on an Ubuntu system running the Nginx web server. We have also shown you how to set up the MySQL/MariaDB database and configure Nginx to use PHP. We hope you have found this tutorial useful.
Thank you for reading this article. Please read other articles on our website.
Related Posts:
- Wordpress Permalink Http 404 On Nginx Here We Go. WordPress Permalink Http 404 On Nginx What is WordPress Permalink? WordPress Permalinks, also known as permanent links, are URLs (Uniform Resource Locators) that are used to access…
- Install Laravel Nginx Ubuntu 18.04 Install Laravel Nginx on Ubuntu 18.04 Introduction In this tutorial, we will look at how to install Laravel with Nginx on an Ubuntu 18.04 server. Laravel is a powerful PHP…
- Digital Ocean Ubuntu Nginx Docker Digital Ocean Ubuntu Nginx Docker What is Digital Ocean? Digital Ocean is a cloud computing provider. It is a great platform for businesses and developers who need to quickly set…
- How To Login Phpmyadmin In Nginx Server Ubuntu How To Login Phpmyadmin In Nginx Server Ubuntu What is Nginx & phpMyAdmin Nginx is a web server software that is commonly used on Linux-based systems, though it works on…
- Php-Fpm Nginx Ubuntu 18.04 PHP-FPM & Nginx on Ubuntu 18.04 Introduction to PHP-FPM PHP-FPM (FastCGI Process Manager) is an implementation of FastCGI, which is a standard protocol for interfacing external applications with web servers.…
- Ubuntu 18 Enable Php Mysql Nginx Ubuntu 18 Enable Php Mysql Nginx Introduction: What Is Ubuntu? Ubuntu is an open source operating system based on the Debian GNU/Linux distribution. Built around the Linux kernel and released…
- How To Install Nginx Maridb 10 On Ubuntu 16.04 Lts How To Install Nginx Maridb 10 On Ubuntu 16.04 Lts Step 1 — Installing Nginx The first step in installing Nginx and MariaDB 10 on Ubuntu 16.04 is installing Nginx.…
- Digital Ocean Ubuntu Server Nginx Docker Digital Ocean Ubuntu Server Nginx Docker Understanding Digital Ocean Digital Ocean is a cloud service provider that focuses on simplifying web infrastructure for cloud developers. They offer a platform where…
- Install Phpmyadmin Ubuntu 18.04 Nginx Install PhpMyAdmin Ubuntu 18.04 Nginx What is PhpMyAdmin? PhpMyAdmin is an open source software written in PHP that provides a graphical web-based interface for accessing and managing your MySQL or…
- Ubuntu Server Postgresql Nginx Php Digitalocean Laravel Ubuntu Server Postgresql Nginx Php Digitalocean Laravel Introduction To The Stack Ubuntu Server, Postgresql, Nginx, PHP, Digitalocean and Laravel are an exceptional combination of elements that, when put together, make…
- Kubectl Install Nginx Wordpress Bare Metal Kubectl Install Nginx Wordpress On Bare Metal Introduction To The Process Of Installing Nginx On Bare Metal With the new trend of cloud and automated solutions, it has become easier…
- Tutorial Start Nginx Ubuntu Webserver Tutorial Start Nginx Ubuntu Webserver Step 1: Prerequisites Before we start configuring Nginx as a web server on Ubuntu, we need to make sure we have the following prerequisites: A…
- How To Setup Nginx On Ubuntu How To Setup Nginx On Ubuntu Introduction Nginx is a powerful web server that is very popular among Linux users. It is open-source and comes with great features such as…
- Install Nginx-Naxsi Ubuntu 16.04 Install Nginx-Naxsi on Ubuntu 16.04 Understanding Nginx and Naxsi Nginx is a high-performance web server which can also be used as a reverse proxy or load balancer. Naxsi is a…
- Install Php Nginx Ubuntu 12.04 Install Php Nginx Ubuntu 12.04 Introduction Welcome to our guide on How to install PHP, Nginx & MySQL on Ubuntu 12.04 LTS. This guide should work on other Linux VPS…
- Install Laravel 5.8 Nginx Php7.3 Install Laravel 5.8 Nginx Php7.3 Overview Installing Laravel 5.8 on a Nginx server running PHP 7.3 can be a tricky task. This tutorial explains how to install the popular open…
- Install Wordpress On Ubuntu Vps On Nginx Install Wordpress On Ubuntu VPS On Nginx What is WordPress? WordPress is an open-source, content management system (CMS) top-tier overall that is used to create powerful online presence. It powers…
- Install Phpmyadmin On Nginx Ubuntu 18.04 Install Phpmyadmin On Nginx Ubuntu 18.04 Introduction PhpMyAdmin is one of the most popular and widely used web-based database management tools available. It is used for administering, managing and maintaining…
- Install Nginx And Php On Ubuntu 18.04 Install Nginx And Php On Ubuntu 18.04 Introduction In this article, we will guide you on how to install Nginx and php on Ubuntu 18.04. Nginx is a popular web…
- Install Php5 Nginx Ubuntu 18.04 Install PHP5 Nginx Ubuntu 18.04 Understanding The Basics of Nginx and PHP Before we learn how to install Nginx and PHP on Ubuntu 18.04, it’s important to understand the basic…
- Install Nginx Passenger Ubuntu 16.04 Install Nginx Passenger Ubuntu 16.04 Installing Nginx On Ubuntu 16.04 Nginx is an open source web server that can be used to create web and application servers. It is a…
- How To Install Nginx On Ubuntu 18.04 How To Install Nginx on Ubuntu 18.04 Introduction Nginx is a popular open-source web server and reverse proxy software that’s used by millions of websites. It’s the most widely used…
- How To Install Phpmyadmin On Nginx How To Install Phpmyadmin On Nginx Introduction PhpMyAdmin is an open source software program which is used to manage MySQL and MariaDB databases. It provides a graphical interface to execute…
- Error Access Denided For User Root On Nginx Ubuntu 18 Error Access Denied For User Root On Nginx Ubuntu 18 What Is Nginx? Nginx is a web server which can be used to serve static files, run web applications, generate…
- Add Root Password Mysql Nginx Ubuntu 16.04 Add Root Password Mysql Nginx Ubuntu 16.04 What is a root password? In the context of computer security, a root password is a user account that is given access to…
- Laravel On Nginx Centos 7 Laravel On Nginx Centos 7 Introduction Laravel is an open-source MVC (model-view-controller) web framework for PHP. It is free and has been used by many developers to create great websites…
- How To Install Wordpress On Nginx How To Install Wordpress On Nginx Introduction If you’re looking to start your own website or blog, probably the easiest and most popular platform to choose is WordPress. WordPress is…
- Step By Step Install Nginx And Phpmyadmin On Ubuntu Step By Step Install Nginx And Phpmyadmin On Ubuntu Introduction Setting up a web server on Ubuntu is easy and straightforward. Nginx is a popular web server for Ubuntu, and…
- Deploy Laravel Nginx Ubuntu 18 Deploy Laravel Nginx Ubuntu 18 Intro to Laravel Laravel is a free, open-source, Model-View-Controller (MVC) web framework written in PHP. It has become one of the most popular web development…
- How Use Nginx Mysql Ubuntu How to Use Nginx, MySQL and Ubuntu What is Nginx? Nginx is an open source web server and reverse proxy software written by Igor Sysoev. It is a popular choice…