Learn to Code via Tutorials on Repl.it!

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

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.

Signup


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

DO NOT GIVE IT YOUR SENSITIVE DATA, SUCH AS ADDRESSES/FULL NAMES

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

Login

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.

NOW PAUSE

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.

Next...

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.

Finally...

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.

EDIT:

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.

Comments
hotnewtop
SamiaMin (3)

hi can you rate my first quiz !!

RowanFromBJC (46)

DO NOT GIVE IT YOUR SENSITIVE DATA, SUCH AS ADDRESSES/FULL NAMES

Now I live on 123 Sesame Street

Great tutorial, works really well!

CoolCoderSJ (507)

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

Bookie0 (5974)

voila

non non non!

c'est voilà!!!!

smh

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 (507)

@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 (507)

@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 (507)

@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 (507)

@Chewyblockguy lmao

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

CoolCoderSJ (507)

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

isaiah08 (63)

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