Part two of this series can be found here
This is post number three ( 3 ) of this series and it’s optional. Our new series about setting up WordPress on Ubuntu shows students and new users how to install and manage WordPress on Ubuntu. This part three ( 3 ) post is only needed if you want WordPress to be powered by LEMP instead of LAMP.
In part two of the series, we showed students how to install the LAMP stack on Ubuntu. The LAMP stack is an acronym for Linux, Apache2, MySQL and PHP. LAMP is the most popular opensource stack to run website and applications.
In this post we’ll show you how to install LEMP on Ubuntu. LEMP is an acronym for Linux, Engine-X (Nginx), MySQL or PHP. Students have the option to either go LAMP or LEMP.
Again, this post is optional. To configure LAMP to run WordPress, apply part one, part two and continue to four of this series. If you prefer to go with LEMP, apply part one, skip part two and continue to part three.
To install LEMP on Ubuntu follow the steps below:
Step 1: Install Nginx
At this point Ubuntu server should be prepared and ready. Run the commands below to install Nginx web server.
sudo apt-get update
sudo apt-get install nginx
After installing Nginx, the commands below can be used to stop, start and enable Nginx to always startup when the server boots up.
sudo systemctl stop nginx.service
sudo systemctl start nginx.service
sudo systemctl enable nginx.service
Step 2: Install MySQL
After installing Nginx, run the commands below to install MySQL database server.
sudo apt-get install mysql-server mysql-client
During the installation of MySQL, you should get a prompt to create and confirm a new password for MySQL root user. This screenshot below shows you how the prompt looks.
After creating and confirming a new root user password, the installation should continue. After installing MySQL the commands below can be used to stop, start and enable MySQL server to always start up when the server boots.
sudo systemctl stop mysql.service
sudo systemctl start mysql.service
sudo systemctl enable mysql.service
STEP 3: INSTALL PHP-FPM
After installing MySQL server, the next step in line is installing PHP and other PHP related modules. PHP is a programming language that WordPress is based upon. Without PHP, WordPress won’t function.
To install PHP and other modules, run the commands below
sudo apt-get install php-fpm php-cli php-fpm php-curl php-mbstring php-mysql php-gd php-zip php-intl php-mcrypt libgd-tools libmcrypt-dev mcrypt php-pear libgd-dev php-pear php-dev
This should get PHP installed and ready.
At this stage, you should have Ubuntu prepared and LEMP installed. The Ubuntu server is now ready to host WordPress websites and blogs.
This is part three of our series that shows students and new users how to install the LEMP stack on Ubuntu to power WordPress. In Part Two we showed you how to install the LAMP stack. Part Three is optional and only needed if you prefer LEMP over LAMP.
If you prefer LAMP, then apply part one, two and continue to four. Skip part three. If you prefer LEMP instead, apply part one, skip part two and continue to three.
Part Two of this series can be found at the link below:
Setting Up WordPress on Ubuntu – Installing LAMP