- So Cloudflare.
I've been talking about it for years,
and I'm a huge fan,
but something I haven't done recently
is a practical tutorial to show you
how to set up Cloudflare on your website the right way.
This video is sponsored by Liquid Web,
more on that later.
So I'm here at Cloudflare,
and the first thing we need to do
is sign up for a free account.
Once you get your account,
websites are billed on a per website basis,
but they do have a free plan, which is great.
And you can have as many free websites
as you'd like within Cloudflare.
Now that I've created my account,
I'm just going to go outta site
in the top bar right here,
and I'm going to start with my domain name.
Now, here's where we pick a plan.
And as you can see, there's a free plan right here.
We just click Get started,
that is what we want.
In the past, Cloudflare has kind of buried this free plan
under these three options.
So if for whatever reason
you load a different version of this page,
just scroll down,
the free plan will be there under all these options.
I can assure you, there is a free Cloudflare plan,
it's not going anywhere.
But thankfully, it seems like they've made it simpler,
so I'm just going to say, Get started on this free plan.
At this point, what Cloudflare is doing
is scanning the DNS records of our domain name.
So if you are migrating to Cloudflare
from an existing website,
so your site's already set up,
it's going to find all the DNS records that you need,
and you'll likely be able to just move on to the next step.
But if you're setting up Cloudflare from scratch,
meaning this is the first time
that you're using your domain name,
or this is the first time you're setting up your website,
this is a screen where you need to enter your IP address.
But as far as getting your IP address for your server,
you can get that from your host.
If you don't see it in your panel anywhere,
just reach out to your host's support,
and they can help you out.
It looks like Cloudflare is finished up
scanning the DNS records
and it's pulled everything in automatically,
so I'm just going to click Continue.
And at this point,
it's time to change the nameservers on our domain.
So I'm gonna go do that in the Porkbun dashboard,
that's where I've purchased my domain from.
But you basically go into your domain registrar panel
and change your nameservers there.
If you're not sure how to do that,
you can find tutorials for your specific registrar.
So here's the Porkbun dashboard.
I've got the nameserver section up right here.
I'm just going to replace the default nameservers
with the Cloudflare ones.
I've got the first one here.
I'll go back over to the Cloudflare tab
and copy the second one.
And this is the thing about Cloudflare.
They actually assign a pair of nameservers
to your specific account,
and everybody's account is different.
So don't copy the nameservers you see
in the video on the screen
because your account may have different nameservers.
But once you have created an account
and nameservers are assigned to it,
you get to use the same nameservers
for every website within your account.
So for my account,
for every website I add to Cloudflare in the future,
these are the two nameservers I use,
and are not changing.
The same is gonna apply for the nameservers
in your account.
I'll take the second nameserver,
go paste it in Porkbun, submit that,
and now my nameservers are changed.
I'm just gonna go back over to Cloudflare
and say Done, check nameservers.
Now, if you've ever changed nameservers before,
you know the drill,
they say it can take up to 24 hours for caches to clear
and DNS to update.
But in my real world experience,
it usually updates within about 15 minutes.
Cloudflare is now inviting us
to walk through their Quick Start Guide.
You could click Get started
and step through the wizard,
but I prefer to edit settings myself at my own pace,
so I'm going to click Finish later.
Now, Cloudflare may give you this message
that the nameservers haven't quite updated yet,
that's okay.
It's going to automatically check
that the nameservers are updated.
And again, typically within about 15 minutes,
the change will be made.
I wanna walk you through how to set up DNS for Cloudflare.
So if you've done everything correctly
and you already have a website set up, chances are,
it copied all those DNS records automatically,
and you don't have to do anything else.
But what if you're setting up your website from scratch?
There's nothing currently on this domain,
so it's not actually pointing anywhere yet.
For that, I will go over to DNS in the sidebar,
and I can begin to modify these records.
Your domain registrar may have put in some default records
like mail forwarding,
and just CNAMES and A Records to point to parking pages.
I'm just gonna clear all of this out
and start from scratch.
So I'm going to be deleting all of these TXT records
and these MX records.
They're not really helpful.
And I will show you how to point your website
to your hosting account.
So this is the DNS management panel
where your DNS records will point to web hosting.
Web hosting is the server where your website files live.
And speaking of web hosting,
that's where today's sponsor, Liquid Web, can help.
Look, here's the thing.
As we get more into web development,
you'll need a hosting solution that can scale with you.
That's when it's nice to have a hosting option like a VPS.
Liquid Web offers VPS solutions starting at $15 a month.
Their virtual private servers
offer 10 terabytes of bandwidth,
automatic backups with the Kronos,
and complimentary access to cPanel, Plesk, or InterWorx.
A VPS is an excellent solution
for websites with growing traffic
or freelancers who need to host multiple websites
for a fraction of the cost of conventional hosting.
If you're an agency or a developer,
you could use a liquid web VPS
to resell hosting to your clients,
and your VPS will be highly scalable.
Liquid Web's VPS was super simple to set up.
And with three management panels to pick from,
you can configure your server to be exactly how you want.
To get your VPS for just $15 a month,
go to the link in the description below.
Thanks to Liquid Web for sponsoring today's video.
And now let's continue setting up Cloudflare.
So I'm back in the DNS management panel,
and I'm gonna show you how to add a basic DNS setup
for your website.
I'm gonna be using one of my Liquid Web VPS
IP addresses to do this.
I'm going to add a record,
and we have A Record already selected.
Now, when you're setting up your website,
you want to type @ in the Name field
to point to your root domain.
So right here, we see our domain name.
If I type something like website,
that actually creates a subdomain,
website, dot, your domain.com.
I want my website to just be my domain.com,
so I'm going to type @,
and then that puts it on our domain name.
For your IP address,
you're gonna wanna get this from your web hosting panel.
Since I am using my Liquid Web VPS,
I'm going to go over to my Liquid Web server,
and just copy my primary IP address.
Go back to Cloudflare and paste that in.
If you don't see your IP address
in your web hosting panel anywhere,
reach out to their customer support,
they can definitely help you out.
I'm gonna save this,
and now we're gonna take care
of adding www. compatibility to your domain name,
because this is actually something we need to do.
Some people are used to typing www. before a domain name,
and believe it or not, this is not automatic.
We actually do have to set this up in our domain's DNS.
It's very simple though.
I'm gonna add a record,
and instead of an A Record,
this time I'm going to select CNAME in the dropdown.
And for name, you could probably guess, it's www.
It's basically creating
a subdomain of www. on our main domain.
But lots of people don't realize that.
They just type www.,
they're used to it.
and they move on with their life.
So for target,
we're simply going to type cftutorial.online.
And for context,
you type your domain here, your main domain,
and this almost acts like a giant redirect.
It's going to route people who type www.
back to your main domain so they can view your website.
Now that we have our DNS pointed to our website,
we wanna make sure that we're using SSL.
An SSL certificate has become standard on websites.
Google Search, for example,
will actually rank your website higher
if you have an SSL certificate.
And browsers like Google Chrome will say Not Secure
on your domain if you're not using SSL.
So it's definitely something that's a requirement,
but the good thing is you don't have to pay for it.
And that's one of the benefits of using Cloudflare.
I'm in the SSL panel here,
and by default, SSL is actually enabled.
But I wanted to walk through what these options mean
because it's important to understand it
so you can be fully aware of what type of SSL
is on your website,
and pick the best option for you.
So, obviously, we could just turn SSL off,
and that's not such a good idea
because then you're gonna get
that Not Secure warning in browsers
and your website is not encrypted.
The basic version of SSL that we could do is flexible.
What this means is you're still gonna see the lock icon
in your browser,
but it's sort of like a fake SSL.
The connection between Cloudflare
and the user browser is encrypted,
so you will get that lock icon in the browser,
but the connection from the Cloudflare server
to your web server is not encrypted.
So you could do this
if you're like a blog or just a basic website
where you're not collecting credit card info,
and you're not an e-commerce store.
But in general,
I would at least recommend full.
What full does is require an SSL certificate
to be installed on the web server.
Sometimes this creates an extra step with your web host
to have to set up,
but all web hosting
has what's called a self-signed certificate
installed by default.
In other words,
everybody should be able to use this full option
without a problem.
I think that's why Cloudflare enables it by default.
Now, if you really wanna step up your security
to the highest level,
you can use what's called full, strict.
And what this does is say,
you actually need a trusted SSL certificate
installed on your web hosting account.
You cannot use one of those self-signed certificates
that your web host will automatically generate.
So if you choose to use full, strict,
you either will have to get an SSL certificate
from somewhere and install it on your web server,
or you can actually go over to this origin server option,
and Cloudflare can generate a trusted certificate
right here from within the panel, for free,
that you can then take and install on your web server.
One of the other benefits of Cloudflare
is having fast, reliable redirects.
If you've ever purchased a domain name
and used your domain registrar's redirect setting
that they have,
where you can just type your domain name,
you know that sometimes those can be so slow.
If you just have an old domain
you want to forward to a new domain,
or whatever the scenario is,
Cloudflare can help you do that,
and it's a lightning fast redirect.
On the Page Rules screen here,
you can say, Create page rule,
and you can actually pick forwarding URL.
There's two types of redirects,
there is permanent and temporary.
And this is just situational.
If you're forwarding an old domain to a new domain,
that old domain is being phased out,
you can select this permanent option.
But if, for example, you're using this like a URL shortener,
and you're gonna be changing
where the link redirects to regularly,
then you might wanna use temporary.
I'll just say permanent
and I'll enter my destination URL.
I can also put which URL I want to redirect.
If I want everything to redirect,
I can do slash, and put the asterisk.
And that's just gonna make sure
that if someone types my domain.com/abc,
no matter what they type,
it's going to redirect.
Or I could specify a specific URL to do the redirect.
Now that we have Cloudflare all set up,
I wanna share a few pro tips with you
that will help you maximize Cloudflare,
and use it to its full potential.
First, there's some things you need to be aware of
in the way of caching.
When you are actively working on your website,
you're making a lot of changes,
it's under development,
on this overview screen,
I highly recommend checking this development mode switch
and enabling it.
What this is going to do is temporarily bypass
the Cloudflare proxy or CDN.
So that way, as you develop your website,
stuff is not getting cached,
and you're not running into problems
thinking you've updated your code,
or you've updated your page builder,
and you're not seeing the changes.
That's very helpful for web development.
The other thing you can do
is if you're not actively developing your website,
but maybe you just make a simple change,
and for whatever reason,
you're not seeing it live,
you can go over to Caching in the sidebar
and go to Configuration.
And where it says Purge Cache,,
just click Purge Everything.
This is going to completely flush the Cloudflare cache,
so that way you can see the changes reflect on your website.
I have had to do this before,
so don't forget,
if you have Cloudflare enable on your website,
and you make a change and you're not seeing it,
go ahead and purge that cache.
You also may wanna take advantage
of Cloudflare's new email routing feature.
It's currently in beta,
and it's a very high-quality email forwarding service.
So just like I was talking about earlier
with the page rules,
and being lightning fast for forwarding a URL,
Cloudflare also lets you forward email for free.
So I could have christian@cftutorial.online
forward to my Gmail address
or any email address I'd like.
To get started with this,
you can click here,
enter your email address,
enter the destination address,
and then say, Create and continue.
And Cloudflare's gonna automatically add the MX records
to your DNS.
Now, you may be saying,
"Christian, what if I have email hosting elsewhere?
What if instead of forwarding an email address,
I wanna be able to use Google Workspace
or a Microsoft Outlook hosting,
what should I do?"
It's really simple.
You just go back to DNS,
and your email host is going to give you the MX records
that you need to enter.
They may also give you some TXT records.
You can just go click Add record,
and select MX or TXT from the list.
You can also type in this dropdown
to make it easier to find the record type.
So right here, we can add an MX record,
I can add a TXT record,
and I can basically add everything
that my email host tells me
needs to be in the DNS.
Then I'll be able to send and receive email with my hosting.
So that's how to set up your website with Cloudflare.
If you have any questions,
be sure to drop a comment down below.
Thanks again to Liquid Web for sponsoring today's video.
And be sure to get your Liquid Web VPS
at the link in the description below.
With that said,
I'll catch you guys next time.