Docker basics: Using mkcert and Caddy with Docker Compose to host web services over HTTPS for local development
📰 Dev.to · Nathan Cook
Learn to host web services over HTTPS for local development using mkcert, Caddy, and Docker Compose
Action Steps
- Install mkcert to generate SSL certificates
- Configure Caddy to use the generated certificates
- Create a Docker Compose file to define the web service
- Run Docker Compose to start the web service over HTTPS
- Test the web service using a browser or tool like curl
Who Needs to Know This
Developers and DevOps engineers can benefit from this tutorial to set up a secure local development environment
Key Insight
💡 Using mkcert and Caddy with Docker Compose simplifies the process of hosting web services over HTTPS for local development
Share This
Host web services over HTTPS for local development using mkcert, Caddy, and Docker Compose 🚀💻
Key Takeaways
Learn to host web services over HTTPS for local development using mkcert, Caddy, and Docker Compose
Full Article
Title: Using mkcert and Caddy with Docker Compose to host web services over HTTPS for local development
URL Source: https://dev.to/moofoo/docker-basics-using-mkcert-and-caddy-with-docker-compose-to-host-web-services-over-https-for-local-2a3d
Published Time: 2026-04-21T07:16:47Z
Markdown Content:
[Skip to content](https://dev.to/moofoo/docker-basics-using-mkcert-and-caddy-with-docker-compose-to-host-web-services-over-https-for-local-2a3d#main-content)
[](https://dev.to/)
[Powered by Algolia](https://www.algolia.com/developers/?utm_source=devto&utm_medium=referral)
[Log in](https://dev.to/enter?signup_subforem=1)[Create account](https://dev.to/enter?signup_subforem=1&state=new-user)
## DEV Community
1 Add reaction
1 Like 0 Unicorn 0 Exploding Head 0 Raised Hands 0 Fire
0 Jump to Comments 0 Save Boost
Copy link
Copied to Clipboard
[Share to X](https://twitter.com/intent/tweet?text=%22Using%20mkcert%20and%20Caddy%20with%20Docker%20Compose%20to%20host%20web%20services%20over%20HTTPS%20for%20local%20development%22%20by%20Nathan%20Cook%20%23DEVCommunity%20https%3A%2F%2Fdev.to%2Fmoofoo%2Fdocker-basics-using-mkcert-and-caddy-with-docker-compose-to-host-web-services-over-https-for-local-2a3d)[Share to LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fdev.to%2Fmoofoo%2Fdocker-basics-using-mkcert-and-caddy-with-docker-compose-to-host-web-services-over-https-for-local-2a3d&title=Using%20mkcert%20and%20Caddy%20with%20Docker%20Compose%20to%20host%20web%20services%20over%20HTTPS%20for%20local%20development&summary=This%20tutorial%20walks%20you%20through%20setting%20up%20a%20simple%20Docker%20Compose%20project%20that%20serves%20two%20Node%20web...&source=DEV%20Community)[Share to Facebook](https://www.facebook.com/sharer.php?u=https%3A%2F%2Fdev.to%2Fmoofoo%2Fdocker-basics-using-mkcert-and-caddy-with-docker-compose-to-host-web-services-over-https-for-local-2a3d)[Share to Mastodon](https://s2f.kytta.dev/?text=https%3A%2F%2Fdev.to%2Fmoofoo%2Fdocker-basics-using-mkcert-and-caddy-with-docker-compose-to-host-web-services-over-https-for-local-2a3d)
[Share Post via...](https://dev.to/moofoo/docker-basics-using-mkcert-and-caddy-with-docker-compose-to-host-web-services-over-https-for-local-2a3d#)[Report Abuse](https://dev.to/report-abuse)
[](https://dev.to/moofoo)
[Nathan Cook](https://dev.to/moofoo)
Posted on Apr 21 • Edited on May 22
1
[](https://dev.to/)
[Powered by Algolia](https://www.algolia.com/developers/?utm_source=devto&utm_medium=referral)
[Log in](https://dev.to/enter?signup_subforem=1)[Create account](https://dev.to/enter?signup_subforem=1&state=new-user)
## DEV Community
1 Add reaction
1 Like 0 Unicorn 0 Exploding Head 0 Raised Hands 0 Fire
0 Jump to Comments 0 Save Boost
Copy link
Copied to Clipboard
[Share to X](https://twitter.com/intent/tweet?text=%22Using%20mkcert%20and%20Caddy%20with%20Docker%20Compose%20to%20host%20web%20services%20over%20HTTPS%20for%20local%20development%22%20by%20Nathan%20Cook%20%23DEVCommunity%20https%3A%2F%2Fdev.to%2Fmoofoo%2Fdocker-basics-using-mkcert-and-caddy-with-docker-compose-to-host-web-services-over-https-for-local-2a3d)[Share to LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fdev.to%2Fmoofoo%2Fdocker-basics-using-mkcert-and-caddy-with-docker-compose-to-host-web-services-over-https-for-local-2a3d&title=Using%20mkcert%20and%20Caddy%20with%20Docker%20Compose%20to%20host%20web%20services%20over%20HTTPS%20for%20local%20development&summary=This%20tutorial%20walks%20you%20through%20setting%20up%20a%20simple%20Docker%20Compose%20project%20that%20serves%20two%20Node%20web...&source=DEV%20Community)[Share to Facebook](https://www.facebook.com/sharer.php?u=https%3A%2F%2Fdev.to%2Fmoofoo%2Fdocker-basics-using-mkcert-and-caddy-with-docker-compose-to-host-web-services-over-https-for-local-2a3d)[Share to Mastodon](https://s2f.kytta.dev/?text=https%3A%2F%2Fdev.to%2Fmoofoo%2Fdocker-basics-using-mkcert-and-caddy-with-docker-compose-to-host-web-services-over-https-for-local-2a3d)
[Share Post via...](https://dev.to/moofoo/docker-basics-using-mkcert-and-caddy-with-docker-compose-to-host-web-services-over-https-for-local-2a3d#)[Report Abuse](https://dev.to/report-abuse)
[](https://dev.to/moofoo)
[Nathan Cook](https://dev.to/moofoo)
Posted on Apr 21 • Edited on May 22
1![Image 12](https://assets.dev.to/assets/raised-hands-74b2099fd66a39f2d7eed
DeepCamp AI