How to install Let’s Encrypt on Ubuntu

Installing Lets Encrypt on your apache web server will add the https to your connection to your webserver.

NOTE: Before you install Lets Encrpyt, you need to have valid hostnames.  So or When you ordered your VPS it may have asked you for a hostname.  If you typed in a valid hostname you can skip this steps below.  If not, you need to get a domain and then update your server and use your desired hostname.

hostnamectl set-hostname hostname-goes-here

apt install -y apache2 apache2-utils
systemctl enable apache2
chown www-data:www-data /var/www/html/ -R
apt install php7.4 libapache2-mod-php7.4 php7.4-mysql php-common php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline -y
a2enmod php7.4
systemctl restart apache2