Skip to content
How to use a Custom Domain with Replit
Profile icon
hacker
has Hacker Plan
DillonB07

Using a Custom Domain with Replit

Introduction

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!

Creating your Repl

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

Repl

So, onto the next step!

Getting a Domain

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.

Choosing your Domain

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.

Choose your domain

"Buy" your domain

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.

"Buy" your domain

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.

Managing Domains

You can manage all of your domains under My Domains

Finding your management area

Now, select your domain.

Managing Domains

Setting up your Domain with Cloudflare

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.

Adding our site to Cloudflare

Now, we need to tell Cloudlflare what our domain is, and prove that it is ours.

Add site to Cloudflare

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.

Linking to your 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 Next

Make sure you keep the repl open or the linking process will stop.

Link Domain

Adding CNAME

Add a new record with the type being CNAME, the name being @ and the target is what you copied from Replit.

Add your CNAME record

Changing nameservers

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.

Change Nameservers

Now, link your domain on Replit.

Confirm Linking

Changing Security

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.

Quick Start

Now, you need to go to SSL and select Full(Strict)

SSL

Finished!

We're all finished setting up our domain now. Head over to your URL, and give it a go!

I have been using this repl: @DillonB07/Custom-Domain-Demo and this domain: https://customdomaindemo.ml

Finished!

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

You are viewing a single comment. View All
Profile icon
notrouchys

@DillonB07
My domain is " www.kazoobot.xyz " and my repl.it domain is " https://kazoo.notrouchys.repl.co " I let it run for 20 hours yesterday and my pc shut down so it stopped, it has been running for another 8 hours now, just loading..
( my website just went down for some reason.. )