DEV Community

Play Button Pause Button
Maxim Orlov
Maxim Orlov

Posted on • Updated on • Originally published at

Setup HTTPS in Development With Create React App

If you ever tried to make HTTPS work in development, you know it's something you can lose your head over 🤯.

How do you get that sweet green lock with Create React App ⚛ on localhost?

In this video, you'll learn how to setup HTTPS in development by creating your own SSL certificates and making sure the browser trusts them.

You only have to follow these steps once, and when you're done, you can reuse the SSL certificates throughout all of your projects.

🔗 Links from video
mkcert -

👉🏼 Watch more videos like this one on my YouTube channel 🎥

Become a skilled Node.js developer

Every other Tuesday I send an email with tips on building solid Node.js applications. If you want to grow as a web developer and move your career forward with me, drop your email here 💌.

Top comments (5)

thpthangnextfunc profile image
Thang Tran

Thank you. Can you create a video: "How to deploy react native app on Google Cloud and point a domain from GoDaddy to that IP" (https secure). I used nginx but it took port 80, someone says let's take nginx as reverse proxy?!

andrewbaisden profile image
Andrew Baisden

Wow awesome that cover video saved me a lot of googling time.

robbiegm profile image

Why would you do this? Every browser API that requires a secure context works on localhost even without setting up HTTPS on it.

doug profile image

Biggest reason I had for this was testing CORS configuration. Too many posts on SO show how to "enable all origins", but that's really not the point.

haloboy777 profile image
Ayush Singh

There are many problems that this video solves.
Sometimes you want to use a custom domain for localhost testing but you don't want to use 'localhost'. In that case the API simply doesn't work and service worker also stops.