Can I get Letsencrypt certificate for local development

Viewed 3669

Right now I'm using self-signed HTTPS certificates for local development and Letsencrypt certificates in production. Is it possible to use Letsencrypt certificates for local development as well? For domains like local.mydomain.com?

I think it's not possible because my local website is not publicly accessible from the outside and therefore Letsencrypt cannot do ACME challenge.

So is there a way to get Letsencrypt certificates locally, or it's not intended to work like that and I should stick with self-signed certificates?

1 Answers

Yes!

You absolutely can!

Let’s Encrypt is not only intended for local development certificates, but also many IoT and on-prem Enterprise solutions that are on private networks, unreachable using the HTTP-01 in production as well.

TXT records: DNS-01 challenge

There are three ways to validate a domain:

  • HTTP-01 over plain HTTP on port 80
  • TLS-ALPN-01 over TLS v1.2+ on port 443
  • DNS-01 over UDP/TCP on port 53

For the DNS challenge you can either manually set a DNS record every so often, or use an automated plugin built specifically for your DNS provider.

Greenlock - a client for all ENVs

I’m the author of Greenlock, which is similar to certbot, but written in plain JavaScript and more geared towards those three use cases I mentioned before:

  • local development
  • IoT
  • Enterprise On-Prem

Try it in your Browser:

Since it’s written in JavaScript, you can try it out right in your web browser, using the manual method:

Use it from your Terminal

There’s also a command line version which currently does manual challenges, but this week I’ll be publishing an update (which is already complete, just undergoing testing) which can save DNS configuration and then do automated renewals as well:

Use it as your Local Server

Lastly, there’s a Greenlock WebServer with automated renewal baked in, which also works with DNS-01, and will also be updated this week:

Related