This video is an extension to • Setting up Unifi on Ubuntu 18.04 where I went through and showed you how to setup the unifi controller in ubuntu. In this video I’m going to show you how to setup LetsEncrypt with your unifi instance so that you can have a valid certificate on your controller. Top do this we’re going to be using a script from Steve Jenkins on Git Hub with cron to automate the renewal.
GitHub Steve Jenkins - https://github.com/stevejenkins
Digital Ocean - https://bit.ly/2Tagact
Steps to follow:
1. Make sure you have unifi installed
2. Install letsencrypt - Sudo apt install letsencrypt
3. Start the certificate process - Sudo letsencrypt certonly
4. Download Steves script - sudo wget https://raw.githubusercontent.com/ste... -O /usr/local/bin/unifi_ssl_import.sh
5. Make the scrip executable - sudo chmod +x /usr/local/bin/unifi_ssl_import.sh
6. Edit the script - sudo nano -w /usr/local/bin/unifi_ssl_import.sh
7. make the appropriate comment changes #. In my case I had to comment out the red-hot lines and uncomment the detain ubuntu lines
8. Change LE_MODE to yes
9. Set your host name at the top of the script unifi.yourdomain.com
10. Run the script - sudo /usr/local/bin/unifi_ssl_import.sh
11. Check to make sure unifi restarted correctly - sudo service unifi status
12. setup cron - sudo nano -w /etc/crontab
13 . Add schedule to cron
0 * * */2 * root letsencrypt renew
5 * * */2 * root unifi_ssl_import.sh
14 . Save cron and enjoy!