HTTPS Server
You can get free SSL/TLS certificates using Let's encrypt. If you want to have https://localhost, follow this tutorial.
To install a certificate from Let's encrypt, we mostly use certbot.
$ sudo apt update
$ sudo apt install snapd
$ sudo snap install core
$ sudo snap refresh core
$ sudo snap install --classic certbot
$ sudo ln -s /snap/bin/certbot /usr/bin/certbot
Ex: To generate one certificate for two domains, on an Apache server.
$ sudo certbot --apache --cert-name xxx.com -d xxx.com -d www.xxx.com
$ sudo certbot --apache -d xxx.com -d www.xxx.com
β‘οΈ You can add as many domains as you want with -d
.
For automatic renewal:
$ sudo certbot renew --dry-run