How To: Use MAMP Pro on Mac OS X With Let’s Encrypt (CertBot/ACME) to Automatically Generate SSL Certificates

How To: Use MAMP Pro on Mac OS X With Let’s Encrypt (CertBot/ACME) to Automatically Generate SSL Certificates

Let’s Encrypt is a free (CA) Certificate Authority that has become a popular alternative for generating free SSL certificates. Let’s Encrypt allows you to create a fully functional SSL certification with chain files that is valid for 3 months (90 days). After 3 months, you can automatically renew the SSL certificate again for another 3 months, and so on.

 

For those of us that host websites using MAMP, you can easily setup your HTTPS sites to use SSL certificates from Let’s Encrypt and have them automatically renewed every 3 months. Let’s get started.

 

Install CertBot & Create SSL Certificates

 

  1. First, we need to install Homebrew for Mac in order to use CertBot from Let’s Encrypt. Type the following command in Terminal to install Homebrew.
 
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

 

Let Homebrew install and do it’s thing. Homebrew may install other dependencies, so let it.

 

  1. Next, type the following command in Terminal to install CertBot.
 
brew install certbot

 

 

  1. Now, we are ready to create an SSL certificate for a website. Type the following command in Terminal below replacing the paths as follows. This command uses “webroot authentication” method which allows CertBot to verify you are the owner of your website by placing a challenge phrase inside /yoursitefolder/.well-known folder and validating your hosting DNS records.
 
sudo certbot certonly --webroot -w /Applications/MAMP/htdocs/MYSITE.COM/ -d mysite.com -d www.mysite.com

 

*Change /Applications/MAMP/htdocs/MYSITE.COM/ to your webroot directory for the site you are creating an SSL certificate for.

*Change mysite.com and www.mysite.com to your domain names.

 

Hit enter. It only takes a few seconds for CertBot to successfully create your SSL certificates.

 

  1. CertBot creates your certificates in a couple locations. Browse to the following path below (Go -> Go to Folder...)
 
/etc/letsencrypt/

 

This is where CertBot will store and renew your SSL certificates! CertBot will create .pem files which will work just fine in MAMP Pro.

 

Lets encrypt certificate locations 

 

Live Folder: Alias’ to our real certificate files in archive folder

Archive Folder: Your actual certificate files.

 

Note: You will have to give yourself access to the Live and Archive folders. Right-Click a folder -> Get Info. Click the lock. Click the “+” and add your Mac user account to the folder and Read & Write access. Click Apply to enclosed items…

 

Certbot live folder permissions

 

  1. Create an alias of the live folder and move the alias to your desktop.
 
Certbot mac live folder alias desktop
 

Configure MAMP Pro to Point to Let’s Encrypt SSL Certificates

 

  1. Open MAMP Pro.
 
  1. Select the HTTP(S) host version of your website and choose the SSL tab.




 
  1. Point to your certificate PEM files. Open each certificate file using the live alias folder on your desktop. Ensure Automatically resolve aliases and symbolic links is checked at the bottom of the window next to options.
 
Mamp pro ssl screen pem certificate files
 
 
Pem files mamp pro certificates folder
 
Certificate File (.key)       = cert1.pem     [Key File]
Certificate Key File (.crt)   = privkey1.pem  [Certificate File]
Certificate Chain File (.crt) = chain1.pem    [CA File]

 

  1. Click Save. MAMP Pro will restart Apache for the new SSL certificates to take affect.
 
  1. Browse to your website and ensure your new Let’s Encrypt certificate is now installed!
 

 

Ssl issued by lets encrypt authority x3

Issued by: Let’s Encrypt Authority X3

 

To ensure you correctly installed your certificates in MAMP Pro, use an SSL validator here.

 

After 90 days, your SSL certificate will expire. To renew your SSL certificate prior to it expiring, issue the command certbot renew.

You can also automate your SSL certificate renewals. See this article.

 

 

Also, see our article on using MAMP to redirect HTTP to HTTPS.

 


* Please use the comment form below. Comments are moderated.*



Related Posts

 

Comments 1

Guest - Robert Trivino on Tuesday, 21 April 2020 19:18

Hi there,
when I use the command below

sudo certbot certonly --webroot -w /Applications/MAMP/htdocs/MYSITE.COM/ -d mysite.com -d http://www.mysite.com

and change it to the location of my site I get a message that that directory doesnt exist.

Can you please advise what i am doing wrong?

Hi there, when I use the command below sudo certbot certonly --webroot -w /Applications/MAMP/htdocs/MYSITE.COM/ -d mysite.com -d www.mysite.com and change it to the location of my site I get a message that that directory doesnt exist. Can you please advise what i am doing wrong?
Friday, 08 November 2024