Article How To Install WordPress With Nginx On Ubuntu 20.04 LTS

  • Thread starter
  • Staff member
Update Ubuntu


First, start by running the standard update command to make sure your system is up to date and avoid any conflicts during installation. I hope this is important given that this is a large setup.

Code:
sudo apt update && sudo apt upgrade -y

Install required packages


For the most part, most of these packages may already be installed on your server; however, re-run the command just to be on the safe side. Packages are very common; you don't install anything fancy.

Code:
sudo apt install curl git wget unzip -y

Install latest version of Nginx - (LEMP)


To start installing the LEMP stack, you need to install the Nginx web server. The method is to install the latest major or stable version of Nginx from the Ondřej Surý repository in order to have the latest software.

In order to use the latest mainstream or stable version of Nginx, you need to first import the repository by adding the PPA.

Option 1 - Import the main repository
Code:
sudo add-apt-repository ppa:ondrej/nginx-mainline -y

Option 2 - Importing a Stable Repository
Code:
sudo add-apt-repository ppa:ondrej/nginx -y

Update your repository to reflect the new change:
Code:
sudo apt update

Now that you have installed the Nginx Repository and updated the list of repositories, install Nginx as follows
Code:
sudo apt install nginx-core nginx-common nginx nginx-full

Now make sure the latest version of Nginx from the Ondřej Surý repository has been installed using the apt-cache policy command.
Code:
apt-cache policy nginx

ezgif.com-gif-maker.jpg

Installing Nginx with a custom repository comes with additional modules compiled, one of the most popular and recommended modules to include is the Brotli module.

Enable the brotli module by opening your nginx.conf config file:nano /etc/nginx/nginx.conf

Now add additional lines before the HTTP {} section:
NGINX:
brotli on;
brotli_comp_level 6;
brotli_static on;
brotli_types application/atom+xml application/javascript application/json application/rss+xml
   application/vnd.ms-fontobject application/x-font-opentype application/x-font-truetype
   application/x-font-ttf application/x-javascript application/xhtml+xml application/xml
   font/eot font/opentype font/otf font/truetype image/svg+xml image/vnd.microsoft.icon
   image/x-icon image/x-win-bitmap text/css text/javascript text/plain text/xml;
The brotli_comp_level slot machine can be set between 1 (lowest) and 11 (highest). Generally most servers are in the middle, but set it to 11 and keep track of CPU usage levels if your server is a monster.

Then check if the changes are working properly before making the changes:
Code:
sudo nginx -t
If the changes work correctly, you should see the following:
Code:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Now make the changes by restarting the server:
Code:
sudo systemctl restart nginx
Then enable Nginx on system boot:
Code:
sudo systemctl enable nginx --now
Finally, make sure Nginx is working properly by checking the status.
Code:
systemctl status nginx
ezgif.com-gif-maker (1).jpg

Configuring the UFW firewall for Nginx


Debian users who have UFW installed will need to configure UFW rules to allow external access to web ports by default. Luckily, Nginx registers itself with UFW during installation to provide several profiles that can be used to enable or disable access, making setup easier and faster.

UFW should be installed by default, but repeat the install command if you're unsure.

Code:
sudo apt install ufw -y
Then enable UFW. When you turn on the firewall, it will deny all incoming and allow all outgoing by default.
Code:
sudo ufw enable
List the application profiles first to see the Nginx profiles available with the following command:
Code:
sudo ufw app list

From the output above, you have three profile options to choose from. To break it down, Nginx runs on port 80 (HTTP), Nginx secure runs on port 443 (HTTPS), and Nginx Full is a combination of allowing both. The most common are Nginx Full or Nginx Secure.

In the tutorial, SSL will be configured later, since almost all users will use it; the best choice is to allow both.
Code:
sudo ufw allow 'Nginx Full'

Install the latest version of MariaDB - (LEMP stack)


The guide will recommend permanently installing MariaDB over MySQL due to performance more than anything else.

First, import the official MariaDB 10.5 or 10.6 repository. For those who don't mind updating the database, install the latest minor version. Lifetime status can be found .

Option 1 - Import MariaDB 10.5 (LTS version):
Code:
curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=10.5
Option 2 - Import MariaDB 10.6 (LTS version):
Code:
curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=10.6
Option 3 - Import MariaDB 10.7 (minor release):
Code:
curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=10.7
Option 4 - Import MariaDB 10.8 (minor release):
Code:
curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=10.8
After selecting the version, update the APT repository.
Code:
sudo apt update
Install MariaDB

To install MariaDB, you need to install the client and server packages. This can be done like this:
Code:
sudo apt install mariadb-server mariadb-client -y
Code:
mariadb --version

Sample output:
Code:
mariadb  Ver 15.1 Distrib 10.7.1-MariaDB, for debian-linux-gnu (x86_64) using readline EditLine wrapper

Remember, this is just an example. You can easily modify MariaDB as described at the beginning of the section.

Check MariaDB Server Status

You have now installed MariaDB and can check the status of the database software using the following systemctl command:
Code:
systemctl status mariadb
MariaDB should be enabled by default. If not, use the following command to activate the service.
Code:
sudo systemctl enable mariadb --now
Now check the status again and you should get this:

systemctl-status-check-mariadb-ok-ubuntu-20.04-for-wordpress.png

The following are some basic systemdcommands for managing and maintaining the MariaDB service.

Stop MariaDB:
Code:
sudo systemctl stop mariadb
Enable MariaDB at system startup:
Code:
sudo systemctl enable mariadb
Disable MariaDB at system startup:
Code:
sudo systemctl disable mariadb
Restart the MariaDB service:
Code:
sudo systemctl restart mariadb

Protect MariaDB with a Security Script

You will then be prompted to enter your (MariaDB root password). In the meantime, press the (LOGIN) key, since the root password has not yet been set, as shown below:

Code:
sudo mysql_secure_installation
Then type (Y) and press Enter to set the (Root) password as shown below:

For the next series of questions, you can safely press (LOGIN), which will answer (Y), to all subsequent questions you are asked (delete anonymous users, disable remote root login, and delete the test database).

Note (Y) is capitalized which means it is the default answer when you press (ENTER) .

An example summary is below:
Code:
$ sudo mariadb-secure-installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n] Y <---- Type Y then press the ENTER KEY.
Enabled successfully!
Reloading privilege tables..
 ... Success!


You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n] Y <---- Type Y then press the ENTER KEY.
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y <---- Type Y then press the ENTER KEY.
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y <---- Type Y then press the ENTER KEY.
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y <---- Type Y then press the ENTER KEY.
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y <---- Type Y then press the ENTER KEY.
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
An overview of what should have been done above:
  • Set a password for root accounts.
  • Removing root accounts accessible from outside the localhost.
  • Deleting anonymous user accounts.
  • Delete the test database, which anonymous users have access to by default.
This step is important to the security of the MariaDB database and should not be changed or skipped unless you know what you are doing.

Install PHP (LEMP STACK)


The last part of the tutorial will cover the installation of PHP, which is the back-end that communicates between Nginx and MariaDB, the middleman. PHP 8.0 is becoming relatively stable and newer versions of PHP 8.1 are now available.

The tutorial will focus on importing the latest version of PHP by Ondrej Suri, the Debian PHP maintainer. This is always true even when new versions of PHP are removed.

PHP PPA import

The first step is to import the PPA.
Code:
sudo add-apt-repository ppa:ondrej/php -y
Please note that you may need to install these dependencies if you run into problems:
Code:
sudo apt install apt-transport-https lsb-release ca-certificates software-properties-common -y
Then update the list of repositories, as the new repository will require updating some existing packages, which is recommended before installing any versions of PHP.
Code:
sudo apt update && sudo apt upgrade

Installing PHP-FPM

To install PHP-FPM, enter the following command.

PHP 8.0:
Code:
sudo apt install php8.0-fpm php8.0-cli php8.0-common php8.0-mbstring php8.0-xmlrpc php8.0-soap php8.0-gd php8.0-xml php8.0-intl php8.0-mysql php8.0-cli php8.0-ldap php8.0-zip php8.0-mcrypt php8.0-curl php8.0-opcache php8.0-readline php8.0-xml php8.0-gd -y
PHP 8.1:
Code:
sudo apt install php8.1-fpm php8.1-cli php8.1-common php8.1-mbstring php8.1-xmlrpc php8.1-soap php8.1-gd php8.1-xml php8.1-intl php8.1-mysql php8.1-cli php8.1-ldap php8.1-zip php8.1-mcrypt php8.1-curl php8.1-opcache php8.1-readline php8.1-xml php8.1-gd -y
Then confirm the installed version to check if the installation was successful with the following command.
Code:
php --version
Sample output:

php-version-output-for-wordpress-on-ubuntu-20.jpg

Finally, check the status of the PHP-FPM service to make sure it is running without errors.
Code:
systemctl status php{version}-fpm
Example with PHP-FPM 8.1:
Code:
systemctl status php8.1-fpm

Sample output:
systemctl-status-check-mariadb-ok-ubuntu-20.jpg

By default, upon installation, the service is enabled in Ubuntu. If the service has not been activated for any reason, use the following command below, then recheck the status.
Code:
sudo systemctl php{version}-fpm enable --now

Install WordPress backend

Visit the WordPress.org and find the latest .zip download link. Then using the wget command, download the file.
Code:
wget https://wordpress.org/latest.zip

Create Folder Structure for WordPress

Now you have the downloaded archive, start unpacking it and moving it to your www directory.

Create a directory for WordPress:
Code:
sudo mkdir -p /var/www/html/wordpress
Unzip WordPress to the www directory:
Code:
sudo unzip latest.zip -d /var/www/html/
You have to set directory owner permissions to WWW or you have issues with write permissions in WordPress.

Set the chown permission (important):
Code:
sudo chown -R www-data:www-data /var/www/html/wordpress/
Set chmod permission folders (important):
Code:
sudo find /var/www/html/wordpress -type d -exec chmod 755 {} \;
Install chmod permission files (important):
Code:
sudo find /var/www/html/wordpress -type f -exec chmod 644 {} \;

Create a database for WordPress

WordPress requires a database to work, so you had to install MariaDB. Before proceeding, you need to create a database for WordPress using MariaDB. First, open a terminal console and type the following.

Raise the MariaDB shell as root:
Code:
sudo mariadb -u root
Then create a database. It can be any name. For guidance, you'll name it "WORDPRESSDB."
SQL:
CREATE DATABASE WORDPRESSDB;

After creating the database, you need to create a new WordPress site user.

This is done as a security measure, so each database has a different user. If one username is compromised, the attacker will not be able to access all databases of another website.

Create a WordPress database user:
SQL:
CREATE USER 'WPUSER'@localhost IDENTIFIED BY 'PASSWORD';

Replace WPUSER and PASSWORD with whatever username or password you want.

Do not copy and paste the default user/password above for security purposes.

Now assign the newly created user access to the database of the WordPress site just below.

Assign the database to the created WordPress user account:
SQL:
GRANT ALL PRIVILEGES ON WORDPRESSDB.* TO [email protected] IDENTIFIED BY 'PASSWORD';

After completing all database configuration settings, you need to reset your privileges to take effect and exit.

Reset privileges:
SQL:
FLUSH PRIVILEGES;
Exit MariaDB:
SQL:
EXIT;

Install WordPress Configuration Files

You need to set some settings in wp-config-sample.php file. Below you will see how to rename the sample file and enter the required information.

Navigate to the WordPress directory:
Code:
cd /var/www/html/wordpress/
Rename configuration file:
Code:
sudo mv wp-config-sample.php wp-config.php
Using a text editor, open the newly renamed wp-config.php file. In our example, we will use nano.
Code:
sudo nano wp-config.php
Next, you'll enter a database name, a user account with a password, and the host's IP address if it's different from localhost.
Code:
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */

define( 'DB_NAME', 'WORDPRESSDB' );                 <--------------- change this

/* MySQL database username */

define( 'DB_USER', 'WPUSER );                               <--------------- change this

/* MySQL database password */

define( 'DB_PASSWORD', 'PASSWORD' );             <--------------- change this

/* MySQL hostname, change the IP here if external DB set up */

define( 'DB_HOST', 'localhost' );

/* Database Charset to use in creating database tables. */

define( 'DB_CHARSET', 'utf8' );

/* The Database Collate type. Don't change this if in doubt. */

define( 'DB_COLLATE', '' );
While you're in this file, adding additional settings will make your WordPress easier to manage, such as saving the file directly instead of using FTP, and increased memory limits.
Code:
##Save files direct method##
define( 'FS_METHOD', 'direct' );

##Increase memory limit, 256MB is recommended##
define('WP_MEMORY_LIMIT', '256M');

##change Wordpress database table prefix if wanted##
$table_prefix = 'wp_';

Install WordPress Security Keys

It would be better to visit the WordPress Secret Key API to generate your own. The Address Salt Key Generator can be found at . Replace the example lines with codes from the generator.

DO NOT COPY THE EXAMPLE BELOW, THIS IS FOR EXAMPLE ONLY.
Code:
define('AUTH_KEY',         '<3yfS7/>%m.Tl^8Wx-Y8-|T77WRK[p>(PtH6V]Dl69^<8|K86[_Z},+THZ25+nJG');
define('SECURE_AUTH_KEY',  'bN#Qy#ChBX#Y`PE/_0N42zxgLD|5XpU[mu.n&:t4q~hg<UP/b8+xFTly_b}f]M;!');
define('LOGGED_IN_KEY',    'owpvIO-+WLG|,1)CQl*%gP1uDp}s(jUbYQ[Wm){O([email protected]#T}tOTP&UOfk|wYsj5$');
define('NONCE_KEY',        '8=Vh|V{D<>`[email protected]])){L+6eGi`GAjV([email protected]&cgb.QVCbi');
define('AUTH_SALT',        '%TX*X$GE-;|?<-^(+K1Un!_Y<hk-Ne2;&{c[-v!{q4&OiJjQon /SHcc/:MB}y#(');
define('SECURE_AUTH_SALT', '=zkDT_%}J4ivjjN+F}:A+s6e64[^uQ<qNO]TfHS>G0elz2B~7Nk.vRcL00cJoo7*');
define('LOGGED_IN_SALT',   '{$-o_ull4|qQ?f=8vP>Vvq8~v>g(2w12`h65ztPM(xo!Fr()5xrqy^k[E~TwI!xn');
define('NONCE_SALT',       'a1G(Q|X`eX$p%6>K:Cba!]/5MAqX+L<A4yU_&CI)*w+#ZB+*yK*u-|]X_9V;:++6');

Nginx server block configuration

Now you are almost ready to install WordPress through the web interface. However, you need to set up an Nginx server block. The settings below are very important. It should be noted to highlight the importance of "Try_files $uri $uri / /index.php?$args;" as this is often a problem with other lessons that leave the final ? $ args If you don't take into account, then the main site health problems come in the WordPress REST API.

First, create a new server configuration file with the following command, replacing the example with your domain name,
Code:
sudo nano /etc/nginx/sites-available/example.com.conf

Below is an example; you can choose details; However, "Location ~\.php$" should be in the Nginx config file.

NOTE. Be sure to change and example.com to your root path.
NGINX:
server {

  listen 80;
  listen [::]:80;
  server_name www.example.com example.com;

  root /var/www/html/wordpress;

  index index.php index.html index.htm index.nginx-debian.html;


  location / {
  try_files $uri $uri/ /index.php?$args;
 }

  location ~* /wp-sitemap.*\.xml {
    try_files $uri $uri/ /index.php$is_args$args;
  }

  client_max_body_size 100M;

  location ~ \.php$ {
    fastcgi_pass unix:/run/php/php8.1-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
    include snippets/fastcgi-php.conf;
    fastcgi_buffer_size 128k;
    fastcgi_buffers 4 128k;
    fastcgi_intercept_errors on;
  }

 gzip on;
 gzip_comp_level 6;
 gzip_min_length 1000;
 gzip_proxied any;
 gzip_disable "msie6";
 gzip_types
     application/atom+xml
     application/geo+json
     application/javascript
     application/x-javascript
     application/json
     application/ld+json
     application/manifest+json
     application/rdf+xml
     application/rss+xml
     application/xhtml+xml
     application/xml
     font/eot
     font/otf
     font/ttf
     image/svg+xml
     text/css
     text/javascript
     text/plain
     text/xml;

  # assets, media
  location ~* \.(?:css(\.map)?|js(\.map)?|jpe?g|png|gif|ico|cur|heic|webp|tiff?|mp3|m4a|aac|ogg|midi?|wav|mp4|mov|webm|mpe?g|avi|ogv|flv|wmv)$ {
      expires    90d;
      access_log off;
  }
 
  # svg, fonts
  location ~* \.(?:svgz?|ttf|ttc|otf|eot|woff2?)$ {
      add_header Access-Control-Allow-Origin "*";
      expires    90d;
      access_log off;
  }

  location ~ /\.ht {
      access_log off;
      log_not_found off;
      deny all;
  }
}
Note, find and replace the above line "Fastcgi_pass unix: /run/php/php8.1-fpm.sock;" in "Fastcgi_pass unix: /run/php/php8.0-fpm.sock;" for 8.0.

Next, you will need to include the Nginx config file from "Sites Available". To do this, you will create a symbolic link to "Supported Sites" namely:
Code:
sudo ln -s /etc/nginx/sites-available/example.com.conf /etc/nginx/sites-enabled/

Don't forget to replace "Example.conf" with the name of your configuration file.

Now you can do a test run and then restart the Nginx server if everything is ok.
Code:
sudo nginx -t
Once you've verified that the Nginx trial run is OK, restart the Nginx service.

Code:
sudo systemctl restart nginx

PHP.ini configuration

Before moving on to the web interface setup part, you should set up PHP for optimal use in WordPress. These settings are more of a guide and you can increase or decrease them as you see fit.

First, bring up your php.ini. Please note that your location may differ depending on your PHP version number.

PHP 8.0 example:
Code:
sudo nano /etc/php/8.0/fpm/php.ini

PHP 8.1 example:
Code:
sudo nano /etc/php/8.1/fpm/php.ini

WordPress media files can be quite large and the default value can be too low. You can increase this to around what you think your largest file size will be.

Please find the following lines below and customize them to suit your needs.
Code:
##increase upload max size recommend 50 to 100mb##
 upload_max_filesize = 100MB

##increase post max size recommend 50 to 100mb##
 post_max_size = 100MB

## increase max execution time recommend 150 to 300##
 max_execution_time = 300

## increase GET/POST/COOKIE input variables recommend 5000 to 10000##
max_input_vars = 5000

## increase memory limit recommend 256mb or 512mb## MAKE SURE THIS MATCHES THE MB SETTING IN YOUR WP-CONFIG.CONF / ENSURE YOUR SYSTEM HAS ENOUGH RAM BEFORE RAISING!!!!
memory_limit = 256M

Now restart the PHP-FPM server.

PHP 8.0 example:
Code:
sudo systemctl restart php8.0-fpm
PHP 8.1 example:
Code:
sudo systemctl restart php8.1-fpm

The PHP settings you configured are for the PHP back end. You will also need to modify the Nginx server block to allow large body sizes. This is done by reopening the server block and adding the following line.

Open your server block.
Code:
sudo nano /etc/nginx/sites-available/example.com
Adjust this line to increase the size of the body.
Code:
client_max_body_size 100M;
Remember that the maximum client size must be the same as your PHP maximum file size setting.

Then check the changes, then restart the Nginx server if everything is ok.
Code:
sudo nginx -t
Once you've verified that the Nginx trial run is OK, restart the Nginx service.
Code:
sudo systemctl restart nginx

Install WordPress frontend

Now that all the internal installation and configuration is complete, you can go to your domain and begin the installation.
Code:
##go to installation address##
 https://www.yoursite.com
##alternative url##
 https://www.yoursite.com/wp-admin/install.php

The first page you will be taken to is the frontend setup wizard.

Example:
08-select-language.png

Select your language, then click Continue.

On the next screen, you can enter your site name, username, password, and email address of the main administrator associated with the WordPress site. In the meantime, make sure you set up a strong password and work email address; all other settings can be changed later in the WordPress settings panel.

Example:
115-wordpress-settings.png

If you're building a website, turn on "Strongly discourage search engines from indexing" to prevent Google, Bing, or any other "Good/reputable search engine bot" from indexing the WIP website.

When you're done, click Install WordPress at the bottom of the screen.
Then, if successful, you should proceed to the next screen informing you about the login.

Example:
1.jpg

Then log in as follows.

Example:
loginscreenrememberme.png

After logging in, you should be taken to your dashboard; from here you can start creating or importing your website.

Example:
2-1.png

Congratulations, you have successfully installed the latest version of WordPress on Nginx with the LEMP stack.

Secure Nginx with a Free Let's Encrypt SSL Certificate

Ideally, you would like to run Nginx on HTTPS using an SSL certificate. The best way to do this is to use Let's Encrypt, a free, automated, and open certificate authority operated by the non-profit Internet Security Research Group (ISRG).

First, install the certbot package as follows.
Code:
sudo apt install python3-certbot-nginx -y
Once installed, run the following command to start generating the certificate:
Code:
sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email [email protected] -d www.example.com

This ideal setup includes forced HTTPS 301 redirect, Strict-Transport-Security header, and OCSP stitching. Just be sure to set up your email address and domain name as per your requirements.

Your URL will now be instead of

If you are using the old HTTP URL, it will be automatically redirected to HTTPS.
Optionally, you can set up a cron job to automatically renew certificates. Certbot provides a script that does this automatically, and you can test first to make sure everything works by doing a test run.
Code:
sudo certbot renew --dry-run
If everything works, open a crontab window using the following terminal command.
Code:
sudo crontab -e
Next, specify the time for the automatic update. This should be checked at least daily, and if the certificate needs to be renewed, the script will not renew the certificate. Use if you need help finding a good time, the calculator is awesome, especially for new users. I highly recommend using this site.
Code:
00 00 */1 * * /usr/sbin/certbot-auto renew

Session save errors

Sometimes you may see your plugins giving you a session save error and this can happen if the user's permissions are not ok in the /var/lib/php/sessions location.

This can be fixed with the following command.
Code:
sudo chown -R www-data:www-data /var/lib/php/sessions/

As above, you set the user and group www-data to the session owner, and this should give WordPress the ability to write session information to the directory. This is for plugins like this that automate tasks like social media posting.

Remember, if something goes wrong, restore the backup.
Code:
sudo cp /etc/php/8.1/fpm/backup-php.ini /etc/php/8.1/fpm/php.ini

Comments and conclusion

WordPress offers a fantastic opportunity to build fast websites with templates and plugins, and the plugin store has a huge amount of options. However, to unlock the full potential of most themes and add-ons, they are all paid, but most of them are affordable.

Self hosting WordPress is pretty fun. However, it is important to keep an eye on security and updates. WordPress is the most targeted CMS in the world for attackers, and your site, even if not listed, will be scanned for exploits on the first day, and hacking attempts will begin.
 
Last edited:
  • Tags
    install wordpress lts nginx ubuntu 20.04
  • Top
    AdBlock Detected

    We get it, advertisements are annoying!

    Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

    I've Disabled AdBlock