Helping You Solve Tech Errors

Install WordPress with LEMP Stack on Ubuntu 20.04

How wonderful it is that nobody need wait a single moment before starting to improve the world.

In this guide, I will show you how to install WordPress on your Ubuntu Server using Nginx and MariaDB. You’ll need a web server like Apache or NGINX with PHP support.

Install WordPress with LEMP Stack on Ubuntu 20.04

WordPress is an open-source, web-based content management and publishing platform driven by the PHP programming language that is widely used throughout the world.

Its installation using LEMP essentially means that Linux is the primary server environment, Nginx is the primary web server, MySQL is the primary database server, and PHP is the primary programming language footprint.

[You may also be interested in: How to Install WordPress on Ubuntu 20.04 Using the LAMP Stack]

You may use MariaDB or MySQL Community Edition for the primary database server since they are both open-source and follow the SQL syntax guidelines.

In Ubuntu, install LEMP Stack.

Whether you’re installing WordPress on a desktop or a server, your operating system must be up to date in order to fulfill all of the necessary performance criteria.

$ sudo apt update && sudo apt upgrade -y

In this stage, we’ll find out how to set up the Nginx web server, MySQL/MariaDB database server, and PHP, as well as any dependencies they may need.

$ sudo apt install nginx mysql-server php php-curl php-mysql php-gd php-intl php-mbstring php-soap php-xml php-xmlrpc php-zip php-fpm -y Install LEMP in UbuntuInstall LEMP in Ubuntu

You may be asked to acknowledge various MySQL server setup procedures as part of the installation process.

Set up MySQL ServerSet up MySQL Server

For example, you will be prompted to choose the default authentication plugin that you like.

Select MySQL Authentication as your authentication method.Select MySQL Authentication as your authentication method.

The LEMP stack installation procedure is then completed, guaranteeing that PHP-FPM, Nginx, and MySQL service daemons are up and operating.

systemctl start nginx php7.4-fpm mysql $ sudo systemctl start nginx php7.4-fpm mysql systemctl status nginx php7.4-fpm $ sudo systemctl status nginx php7.4-fpm mysql systemctl enable nginx php7.4-fpm $ sudo systemctl enable nginx php7.4-fpm mysql

In Ubuntu, install WordPress.

When you download and configure your WordPress site, you’ll need a main database to house all of the database tables. You may need to secure your MySQL installation before logging into the MySQL interface.

mysql secure installation $ mysql secure installation

The command above also aids in the creation of the root user password for your MySQL database, as well as other crucial database setup settings.

Log in to your MySQL shell using the root user credentials you just created:

mysql -u root -p $ mysql -u root -p $ mysql -u

Create a WordPress database and a user for it.

mysql> CREATE DATABASE wordpress_db; mysql> CREATE USER ‘wpuser’@’localhost’ IDENTIFIED BY ‘pa55word’; mysql> GRANT ALL PRIVILEGES ON wordpress_db; mysql> FLUSH PRIVILEGES; mysql> exit; Create WordPress DatabaseCreate WordPress Database

The next step is to travel to the directory that Nginx has designated as its default webroot.

$ cd /var/www/html/html/html/html/html/html/html/html/html/html Download the most recent WordPress version: wget http://wordpress.org/latest.tar.gz $ sudo wget http://wordpress.org/latest.tar.gz tar -xzvf latest.tar.gz $ sudo tar -xzvf latest.tar.gz

Set the proper directory permissions for your website.

/var/www/html/wordpress $ sudo chown -R www-data:www-data /var/www/html/wordpress $ sudo chmod -R 775

To connect to the MySQL database, generate a WordPress database setup file.

cd wordpress wordpress wordpress wordpress wordpress wordpress wordpress wordpress $ sudo wp-config-sample.php wp-config-sample.php wp-config-sample.php wp-config wp-config.php wp-config.php wp-config.php wp-config.php wp-config.php

Fill in the database credentials you generated previously in this file.

WordPress Database ConfigurationWordPress Database Configuration

Create your unique values for this section of the wp-config.php file using the WordPress secret key generator.

Secret Keys for WordPress may be generated in a number of ways.Secret Keys for WordPress may be generated in a number of ways.

Will take the form of:

Secret Keys in WordPress: How to Set Them UpSecret Keys in WordPress: How to Set Them Up

Set up Nginx for WordPress.

For our WordPress website, the first step is to establish a virtual nginx server block.

/etc/nginx/conf.d/wordpress.conf $ sudo nano

Your file’s implementation should look like this:

server { listen 80; listen [::]:80; root /var/www/html/wordpress; index index.php index.html index.htm; server_name linuxshelltips.network www.linuxshelltips.network; error_log /var/log/nginx/linuxshelltips.network_error.log; access_log /var/log/nginx/linuxshelltips.network_access.log; client_max_body_size 100M; location / { try_files $uri $uri/ /index.php?$args; } location ~ .php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.4-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } Create WordPress Nginx Server BlockCreate WordPress Nginx Server Block

To prevent Nginx from automatically routing requests, remove the default Nginx server blocks.

rm /etc/nginx/sites-enabled/default $ sudo rm /etc/nginx/sites-enabled/default rm /etc/nginx/sites-available/default $ sudo rm /etc/nginx/sites-available/default

Restart Nginx after checking for syntax issues in the configuration.

$ sudo nginx -t $ sudo systemctl restart nginx Check Nginx ConfigurationCheck Nginx Configuration

Install WordPress Using the Wizard

From the set URL, we can now view our WordPress site.

http://linuxshelltips.network Choose WordPress LanguageChoose WordPress Language

To install WordPress successfully, follow the setup instructions.

WordPress Site DetailsWordPress Site Details In Ubuntu, install WordPress.In Ubuntu, install WordPress.

Under the LEMP stack in Ubuntu, you may finally take use of everything WordPress has to offer.

Watch This Video-

Share this article:
Share on facebook
Share on twitter
Share on telegram
Share on whatsapp
you may also like

what you need to know

in your inbox every morning