Install free SSL certificates on AWS EC2 (using "SSL For Free")

Category: Tech Stuff | Last updated: January 15, 2020


Following steps can be used to install SSL certificate on an AWS EC2 instance.

  1. Install mod_ssl on your EC2 instance.
    • sudo yum install -y mod24_ssl
  2. Get SSL certificates for your domain from https://www.sslforfree.com
  3. Upload the certificate files to following directories on your EC2 instance:
    • /etc/pki/tls/private/private.key
    • /etc/pki/tls/certs/certificate.crt
    • /etc/pki/tls/certs/ca_bundle.crt
  4. Edit /etc/httpd/conf.d/ssl.conf file to use above paths.
    • SSLCertificateFile /etc/pki/tls/certs/certificate.crt

      SSLCertificateKeyFile /etc/pki/tls/private/private.key

      SSLCACertificateFile /etc/pki/tls/certs/ca_bundle.crt

Make sure that HTTPS traffic is allowed on your server.

For more details check https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-amazon-linux-ami.html

Note:

Sometimes you might also have to add chain certificate.

In such case, please visit https://whatsmychaincert.com and test whether your server is using correct chain certificate.

If not, then you can generate the chain certificate and upload to /etc/pki/tls/certs/server-chain.crt

Make sure to edit /etc/httpd/conf.d/ssl.conf to use appropriate path of the chain certificate.

Get In Touch

Dropping a line to say g’day, ask for my resume or see if we can build something amazing together? I’d love to hear from you!

Email me at

Follow me: