Stop the web server:
sudo systemctl stop apache2
# or if you are using Nginx
sudo systemctl stop nginx
Run Certbot to obtain the certificate:
sudo certbot certonly --standalone -d yourdomain.com
Restart the web server:
sudo systemctl start apache2
# or if you are using Nginx
sudo systemctl start nginx