DEV Community

loading...
Cover image for Automated local HTTPS environment with Traefik

Automated local HTTPS environment with Traefik

Cameron Wilby
I code a lot
・1 min read

Traefik is an open-source edge router that intelligently routes incoming HTTP and TCP traffic to services that it's able to find dynamically.

It natively integrates with service providers like Kubernetes, Docker, Amazon ECS, and Azure Service Fabric making it incredibly versatile.

This means you can start your Docker containers with a few labels specifying the URL (e.g. https://foo.test) and Traefik will do the heavy lifting of routing HTTP requests it receives matching that URL to that container.

To go further, it can also manage creating and renewing LetsEncrypt certificates! 🤯

I wanted to share a project I created on GitHub to get started with a local Traefik environment to serve local containers via HTTPS and named domains. As it's intended for a local environment and you likely don't own traefik.test, you'll need mkcert to create HTTPS certificates signed by your very own local certificate authority.

You can learn more about Traefik through their documentation here, which is a fun read and informative when you're ready to move away from localhost.

See you on GitHub!

https://github.com/cwilby/simple-local-traefik

Discussion (0)

Forem Open with the Forem app