Search Our Database
How to install “Let’s Encrypt SSL Certificate” from SSH (Directadmin)
Introduction
This guide explains how to install a Let’s Encrypt SSL certificate on a DirectAdmin-managed domain using SSH. It’s intended for users who want to secure their websites with free SSL certificates provided by Let’s Encrypt. You should follow these steps when you need to enhance the security of your DirectAdmin-hosted domain. The process involves using SSH to integrate and manage these certificates efficiently within DirectAdmin, ensuring your website is protected with secure HTTPS connections.
Prerequisites
- SSH access to your server.
- Administrative privileges on DirectAdmin.
- DirectAdmin installed and configured on the server.
Step-by-step Guide
Step 1: SSH to the Server
Begin by logging into your server using SSH. You may refer to the link below:
https://www.ipserverone.info/knowledge-base/how-to-ssh-into-your-cloud/
Step 2: Enable Let’s Encrypt in DirectAdmin Configuration
Once logged in, you’ll need to modify the DirectAdmin configuration file to enable Let’s Encrypt support.
Open the directadmin.conf file with the following command:
vi /usr/local/directadmin/conf/directadmin.conf
Add the following line to enable Let’s Encrypt:
letsencrypt=1
After that, save the file and exit.
Step 3: Configure Apache for Let’s Encrypt
Now, you’ll need to modify the Apache configuration to allow Let’s Encrypt to verify domain ownership by creating an alias for the challenge directory:
vi /etc/httpd/conf/extra/httpd-alias.conf
Add the following line to the file:
Alias /.well-known/acme-challenge /var/www/html/.well-known/acme-challenge
Save and exit the file.
Step 4: Update and Install Let’s Encrypt
Next, navigate to the DirectAdmin custom build directory and run the following commands to update DirectAdmin and install Let’s Encrypt:
cd /usr/local/directadmin/custombuild ./build update ./build letsencrypt
This will ensure that DirectAdmin is updated and that Let’s Encrypt is properly installed and integrated.
Step 5: Restart Apache and DirectAdmin Services
After making these changes, restart both the Apache (httpd) and DirectAdmin services to apply the new settings:
service httpd restart service directadmin restart
Step 6: Enable Let’s Encrypt in DirectAdmin for Your Domain
Once the services are restarted, log in to the user’s DirectAdmin account and enable Let’s Encrypt for the domain by following these steps:
- Navigate to SSL Certificate under the domain management section.
- Select the option labeled Free & automatic certificate from Let’s Encrypt.
- Save the changes.
The Let’s Encrypt SSL certificate will now be installed for the domain, providing HTTPS security.
Conclusion
By following these steps, you have successfully installed a Let’s Encrypt SSL certificate on your DirectAdmin domain via SSH. This free SSL certificate will help secure your domain with encrypted connections.
Article posted on 8 September 2019 by Mohammad Nadzir B Nazuwan