Learn to Code via Tutorials on Repl.it!

← Back to all posts
Link Domains with Replit
CoolCoderSJ (595)

How to link a domain with Replit

Yes, there is already a tutorial...but that tutorial isn't very clear, it doesn't show cloudflare thingies, but most of all, things have changed. Namely the fact that linking a domain has gotten harder for some reason... ;)
This tutorial will show you how to link a domain from scratch.

I highly recommend getting a domain from a domain provider that isn't freenom, but since the majority of the community uses freenom, that's what this tutorial will use.

Part 1: Find your domain

Step 1: Head on over to Freenom, click in the big search bar in the middle of the page, enter your domain, and click enter.

Next to the domain you want, click Get it now!

Click checkout

Select forward this domain, enter your current replit domain, and on the right, select @12 Months Free

Click continue

Now, if you don't have an account, enter your email to verify it.

Note: Only GMAIL is allowed lmao idk why

If you have an account, use Google OAUTH to login.


If you choose to signup, check for an email for email confirm. Click the link inside of it, and fill out the info.


Just fill in some fake stuff as freenom isnt that trustworthy.


If you choose to login, it will redirect you to some random page. Click here to go to your cart and proceed to checkout.

Agree to terms and complete order.
Now click here to go to your domains dashboard.

Part2: Setting it up with Cloudflare

For it to work with replit, it must be linked with cloudflare or another domain provider. Next to your domain, click Manage Domain.

On the menu bar, click Management tools > Nameservers and select Use default Nameservers.

Click Use Custom Nameservers and pause...
In another tab, open Cloudflare

Either Login or signup from the navigation bar

Once you're logged in, check the navbar top right for a link to add a domain.
Click that link.

Enter your domain and click Add site.
NOTE: It may take multiple tries and a lot of time before it works.

Once it actually loads, scroll down and select the free plan, unless you want to pay for cloudflare pro.

Click continue

Wait for it to scan existing DNS records, it should find none.

Option 1: Root and WWW

Click Add record (We will be doing these steps twice)

From the dropdown, select CNAME

Set the name of the record as @. This is the root domain, so for example, Google has these two CNAME records,

google.com, and www.google.com

If you do not add a root record, you would have to add www in front of it every time.


Go to the repl you are linking

Click the pencil icon next to the domain on replit

Enter the domain you are linking, enter the domain without the www. (Example - replitiscool.tk)

Click the COPY button

Now head back to cloudflare and enter the copied ur into the target box.

Click Save, then add another record. Select CNAME from the dropwdown, name the record as www, and paste the text replit gave u into the target.

Option 2: Subdomains

Go to the repl you are linking

Click the pencil icon next to the domain on replit

Enter the domain you are linking, including subdomain. (Example - project.replitiscool.tk)

Click the COPY button

Now head back to cloudflare and enter the copied ur into the target box.
Click Save.


Click continue.

It might give you some NAMESERVERS and tell you to update nameservers. IF that is the case, go back to freenom, (Click here) manage domain > Management tools > nameservers
Click use custom nameservers, then enter the nameservers cloudflare gave you. Click Save, and click continue on cloudflare.

On the top bar, click SSL/TLS

Choose Full, it should be the second to last option.


GO back to replit and click next. after some time, a LINK DOMAIN button should appear.

Click it, and voilà! You have successfully linked your domain.


On your first try, you may get a 525 SSL Handshake error, if you do, be patient, wait a bit, and reload. It takes a bit to update.

SamiaMin (3)

hi can you rate my first quiz !!

RowanFromBJC (50)


Now I live on 123 Sesame Street

Great tutorial, works really well!

CoolCoderSJ (595)

@RowanFromBJC lol
thanks, i just felt like a new tutorial was needed

Bookie0 (6258)


non non non!

c'est voilà!!!!


ruiwenge2 (503)

for some reason every domain that find says "not available"

arjun418 (2)

@ruiwenge2 Same for me I wonder why

arjun418 (2)

@ruiwenge2 I know right! I was hoping to get a free domain for my website

arjun418 (2)

Ive tried every website there is @ruiwenge2

arjun418 (2)

@ruiwenge2 MAN! It just worked! Add the back of you domain to get it to work

ex: instaed of hello search hello.tk

ruiwenge2 (503)

@arjun418 lucky... i typed in hello.tk, and every domain that i found (.tk, .ml, .ga, .cf, .gq, etc) wasn't available :(

ruiwenge2 (503)

@arjun418 wait, it worked!!!!!!! thank you!

arjun418 (2)

@ruiwenge2 dont do hello and stuff do something original

ch1ck3n (2035)

ok now i'm getting "cknlinks.tk redirected you too many times"

ch1ck3n (2035)

ok i have a problem (maybe)

i click "link domain" on replit and it says linking domain... but like in one second it changes back to the normal button. is that normal

CoolCoderSJ (595)

@ch1ck3n yeah its a bit broken, use an autoclicker.

CubeyTheCube (24)

My domain randomly gives 525 and 502 errors a lot of the time... and I have no idea why. I set the SSL to Full.

CoolCoderSJ (595)

@CubeyTheCube 525 is normal a couple of times, not too many- 502 is an application error, not cloudflare or your domain.

CubeyTheCube (24)

@CoolCoderSJ My website has been up for a month, and this started happening 2 days ago with no changes to the code.

Chewyblockguy (9)

do you have to do the nameserver stuff on cloudflare?

CoolCoderSJ (595)

@Chewyblockguy yes, if you dont do the nameserver stuff cloudflare wont activate, and domains on replit doesnt work without cloudflare anymore.

Chewyblockguy (9)

I had no idea you could get a free domain name! thanks sooooooooo much

CoolCoderSJ (595)

@Chewyblockguy While you can get free domains, freenom is heavily recommended against, because they technically own all domains, you get ZERO SEO, and they can resell your domain whenver they want. If your domain becomes too popular, it gets suspended until you pay.

Chewyblockguy (9)

@CoolCoderSJ whelp if I ever have a ton of veiws Ill just add ads so I can get a .com namecheap domain = P

CoolCoderSJ (595)

@Chewyblockguy lmao

Also freenom can place ads on ur site if they want without asking u, but the money goes to them...\

ch1ck3n (2035)

@CoolCoderSJ :O i have no problem with ads on my site

ads make it look professional hehehehe

CoolCoderSJ (595)

@isaiah08 did you do all of the steps? Especially setting SSL to Full?

isaiah08 (71)

Thanks! I must have forgotten to do that! @CoolCoderSJ