User Tools

Site Tools


lemp-install

This is an old revision of the document!


How to install a LEMP Webserver

A LEMP Server includes NGINX, MariaDB and PHP. For easier administration, we are also going to add PHPmyadmin. As we also need to make sure our sites are secure, we will also be adding Certbot

For this you will need a vanilla Ubuntu Server installation, please find it here
You will need to open up either an ssh client or Putty if on a Windows machine.

Install Nginx

  • Type these into your terminal - and open up the ports 80/443 by using the ufw command shown
sudo apt update
sudo apt upgrade
sudo apt install nginx
 
sudo ufw allow http https
  • Create a directory for your webserver files etc - but change this to your own preferences
sudo mkdir /media/webdisk/web-data
  • Change the permission so Nginx can use this folder:
sudo chown www-data:www-data /media/webdisk/web-data -R

Install MariaDB

  • Type in these commands
sudo apt install MariaDB-server MariaDB-client
sudo systemctl start MariaDB
sudo systemctl enable MariaDB

Now secure MariaDB by typing this:

sudo mysql_secure_installation
lemp-install.1603361248.txt.gz · Last modified: 2023/05/17 22:52 (external edit)