# How to automatically renew certificates?

**URL:** <https://community.letsencrypt.org/t/how-to-automatically-renew-certificates/4393>\
**Category:** Help\
**Created:** [November 24, 2015, 1:13pm UTC](https://community.letsencrypt.org/t/how-to-automatically-renew-certificates/4393 "2015-11-24T13:13:31Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![mikeskril](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@mikeskril](https://community.letsencrypt.org/u/mikeskril)\
**Post date:** [November 25, 2015, 6:13pm UTC](https://community.letsencrypt.org/t/how-to-automatically-renew-certificates/4393/7 "2015-11-25T18:13:12Z")

</div>

To be honest, I call the below script in `crontab`.

```
# Renew Let's Encrypt SSL cert
                                                                                                                                               

                                                                                                                                               
cd /opt/letsencrypt/
./letsencrypt-auto --config /etc/letsencrypt/cli.ini -d yourdomain.com -d www.yourdomain.com certonly
                                                                                                                                               
if [$? -ne 0]
 then
        ERRORLOG=`tail /var/log/letsencrypt/letsencrypt.log`
        echo -e "The Lets Encrypt Cert has not been renewed! \n \n" $ERRORLOG | mail -s "Lets Encrypt Cert Alert" postmaster@yourdomain.com
 else
        service apache2 reload
fi
                                                                                                                                               
exit 0
```

---

_[View the full topic](https://community.letsencrypt.org/t/how-to-automatically-renew-certificates/4393)._
