How to use a Custom Domain with Replit
Do you dislike your long repl.co domain? Or, do you want a more memorable one? Well, whatever the reason, this tutorial is for you!
There are many tutorials for this, but most of them are outdated and no longer work.
So, I thought I would create my own accurate tutorial!
Let's get started!
Well, I'll assume you already have a repl that hosts a web application.
- If you are in a team, you must be the owner of the team to do this!
- For a multiplayer repl, you need to be the owner of the repl
So, onto the next step!
Well, you obviously need a domain to add a custom domain to your repl!
For this tutorial, I'll be getting a free domain from Freenom, but you can get yours from anywhere.
We're going to be getting a domain from Freenom.
Search for a domain you would like and click
Get it now!, then
Checkout Freenom is very slow to load. Be patient
If you can't use the
Get it now! button, search for the domain with the extension on the end.
Select the period you would like from the
PERIOD dropdown. I recommend
12 months @ FREE if you want it for free. Then, click
Continue. Now, complete your order after agreeing to the Terms and Conditions.
If you have never used Freenom before, you will be asked to create an account. Do this, and I'll see you on the next step.
You can manage all of your domains under
Now, select your domain.
Now, we'll add our domain to Cloudlfare. You don't have to do this, though your website will be faster and more secure if you do do this. And it's free, so why not?
So, create or sign into a Cloudflare account.
Now, we need to tell Cloudlflare what our domain is, and prove that it is ours.
Now, select a plan. I'll use Free.
It will scan for DNS records, and now is the time to link our domain to our repl.
Go back to your repl. Click the pencil icon on the web preview and enter your domain.
Replit will give you a CNAME record. Copy that, because we will need it for the next step.
Go ahead and press
Make sure you keep the repl open or the linking process will stop.
Add a new record with the type being
CNAME, the name being
@ and the target is what you copied from Replit.
The penultimate step is here. We need to change our domain's nameservers for use with Cloudflare.
The nameservers you are given are random, and won't be the same every time. So, don't copy my ones, or ones that you have had in the past.
Now, link your domain on Replit.
The final thing to do is to change some Cloudflare security settings. You won't be able to access your website if you don't do this.
Go through the Quick Start Guide turning everything
On This isn't necessary, but it provides a better experience to the visitors of your website.
Now, you need to go to SSL and select Full(Strict)
We're all finished setting up our domain now. Head over to your URL, and give it a go!
I hope this tutorial was helpful. If you have any questions or issues, please leave them in the comments, and I'll reply as soon as I can.
If you have a suggestion for another post like this, also leave it in the comments, and I'll try and make it!
Replit has removed svg functionality ;( svg files cannot be displayed: https://replanalytics.repl.co/track/02213d3b-c496-4700-a40f-b0f03d53b46c/empty.svg