Install dnsutils and certbot
sudo apt -y install dnsutils certbot
You can use command
host
from dnsutils to test your dns settings
sudo certbot certonly --manual --preferred-challenges dns -d your-domain-name
Answer the questions and wait for the end of the challenge.
You can control changing TXT record in dns with command
host -t txt _acme...you-domain
If you get successful result, you can copy certificate and key to Monitor folder:
sudo cp /etc/letsencrypt/live/your-domain-name/fullchain.pem ~/path_to_cert_folder/certificate.pem
sudo cp /etc/letsencrypt/live/your-domain-name/privkey.pem ~/path_to_cert_folder/privkey.pem
Change
your-domain-name
to your real domain name
or grant permissions to your user to access to cetificate and key.
Change owner and access:
sudo chown user:user ~/path_to_cert_folder/certificate.pem
sudo chown user:user ~/path_to_cert_folder/privkey.pem
chmod 755 ~/path_to_cert_folder/certificate.pem
chmod 600 ~/path_to_cert_folder/privkey.pem
Change
user
to your real username in system
sudo addgroup certgroup
sudo usermod -aG certgroup root
sudo usermod -aG certgroup $USER
sudo chgrp -R certgroup /etc/letsencrypt/live
sudo chgrp -R certgroup /etc/letsencrypt/archive
sudo chmod -R 750 /etc/letsencrypt/live
sudo chmod -R 750 /etc/letsencrypt/archive