<\/span><\/h2>\r\n\r\n\r\n\r\nFirst, log in to your Ubuntu 20.04 server via SSH as the root user:<\/p>\r\n\r\n\r\n\r\n
ssh root@IP_Address -p Port_number<\/pre>\r\n\r\n\r\n\r\nYou will need to replace \u2018IP_Address\u2018 and \u2018Port_number\u2018 with your server\u2019s respective IP address and SSH port number. Additionally, replace \u2018root\u2019 with the username of the admin account if necessary.<\/p>\r\n\r\n\r\n\r\n
Before starting, you have to make sure that all Ubuntu OS packages installed on the server are up to date. You can do this by running the following commands:<\/p>\r\n\r\n\r\n\r\n
apt-get update -y\r\napt-get upgrade -y<\/pre>\r\n\r\n\r\n\r\n<\/span>Install Nginx<\/span><\/h2>\r\n\r\n\r\n\r\nBy default, the latest version of Nginx is available in the Ubuntu 20.04 default repository. You can install it with the following command:<\/p>\r\n\r\n\r\n\r\n
apt-get install nginx -y<\/pre>\r\n\r\n\r\n\r\nAfter installing Nginx, start the Nginx service and enable it to start at system reboot with the following command:<\/p>\r\n\r\n\r\n\r\n
systemctl start nginx\r\nsystemctl enable nginx<\/pre>\r\n\r\n\r\n\r\nYou can also verify the installed version of Nginx using the following command:<\/p>\r\n\r\n\r\n\r\n
nginx -v<\/pre>\r\n\r\n\r\n\r\nYou should get the following output:<\/p>\r\n\r\n\r\n\r\n
nginx version: nginx\/1.18.0 (Ubuntu)\r\n<\/pre>\r\n\r\n\r\n\r\n<\/span>Install PHP7.4<\/span><\/h2>\r\n\r\n\r\n\r\nBy default, Ubuntu 20.04 ships with PHP 7.4 in its upstream repositories. You can install it easily by just running the following command:<\/p>\r\n\r\n\r\n\r\n
apt-get install php7.4 -y<\/pre>\r\n\r\n\r\n\r\nOnce the PHP is installed, verify the installed version with the following command:<\/p>\r\n\r\n\r\n\r\n
php --version<\/pre>\r\n\r\n\r\n\r\nYou should get the following output:<\/p>\r\n\r\n\r\n\r\n
PHP 7.4.3 (cli) (built: Oct 6 2020 15:47:56) ( NTS )\r\nCopyright (c) The PHP Group\r\nZend Engine v3.4.0, Copyright (c) Zend Technologies\r\n with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies\r\n<\/pre>\r\n\r\n\r\n\r\nPHP configurations related to Nginx is stored in \/etc\/php\/7.4\/fpm\/php.ini file. You can modify it for better performance.<\/p>\r\n\r\n\r\n\r\n