BEGIN TYPING YOUR SEARCH ABOVE AND PRESS RETURN TO SEARCH. PRESS ESC TO CANCEL

Free SSL Certificates with LetsEncrypt and Ajenti-v

So this is going to be a very quick post on how to use LetsEncrypt SSL certificates on your Ajenti-v setup. Ajenti-v will probably be supporting this natively at some point, there is an open issue on their Github here. But in the meantime you can just follow these steps to start using LetsEncrypt now.

Step 1. Install LetsEncrypt.

You can click this link and head to ‘Getting Started’  or you can just run these commands to install LetsEncrypt in the folder of your choice:

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt

So now LetsEncrypt is installed, LetsEncrypt doesn’t yet support nGinx and since that’s what I’m using I’ll assume that’s what you’re using, the automatic function won’t work for us so we will have to use the ‘certonly’ option. Run the following command and follow the steps.

service nginx stop
./letsencrypt-auto certonly 

Now you should get a message like:

Congratulations! Your certificate and chain have been saved at
   /etc/letsencrypt/live/yourdomain.com/fullchain.pem.

You can now restart nginx by running:

service nginx start

Now that we have the cert, it’s time to see how we fit this into Ajenti. Open up the websites tab of Ajenti and open whatever website you’ve decided to do this for, hit the SSL tab and you will get this window:

ajenti-certs

So the first box get’s filled in with what the wizard returned to us:

/etc/letsencrypt/live/yourdomain.com/fullchain.pem

The second box gets filled in with the certificates private key:

/etc/letsencrypt/live/yourdomain.com/privkey.pem

Now Ajenti knows what certificate to use it’s time to turn SSL on, lets get the Advanced configuration out of the way first:

ajenti-advanced-cert

 

The ‘Custom top level configuration’ you see will automatically redirect users accessing your website on http:// to the https:// domain.

Lastly we just need to change the website port from the default 80 to SSL’s 443:

ajenti-ssl-ports

Apply changes, and check to make sure your website is still redirecting. Easy peasy! 🙂

  • benji

    The custom top level configuration causes my website to redirect loop. Thanks for taking the time to write this up.

  • benji

    I forgot I had a redirect from https to http already which was causing a loop when I added your code. All is working fine now.

  • just_insane

    Is there a way to renew the cert automatically?

  • You’d need to set up a cronjob to achieve this currently if you are using nginx.

  • Fedot Serghei

    To renew the certs i run the same command?

  • Yep exact same command!