To add a password to your site:
apt install apache2-utils
htpasswd -c /etc/apache2/.htpasswd user
# Config
<Directory "/var/www/html">
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Directory>