Skip to main content

Part 1 - Enabling CloudFlare

CloudFlare - you probably heard of it, but what exactly is it? And more importantly, do you need it?

The picture below explains to some degree what CloudFlare does - it speeds up websites, and blocks attackers.


If that is all you needed to know, you can skip reading the next section.

What CloudFlare does


Here is a slightly longer explanation.

The idea is that a caching service like CloudFlare is built to provide fast web access to your site for everyone no matter where they live. It does this by having high-speed connections around the world.

No matter where your site is hosted, people hitting your site get the data via the cache and, when not cached, their cache populates from a local server that connects to your actual site.

There are a lot of people that swear this drastically improves Plex performance, especially those operating their VPS in different countries.

It may not impact you especially if your VPS is close to where you live, but if this sounds like something you could use, it's definitely worth setting up.

Be aware that you really need to follow ALL the instructions carefully, especially if you are going to use it with Plex, because you could potentially leave your server wide open for hackers if you skip steps. Don't say you weren't warned, and don't complain to me if things go wrong :)

With that out of the way, let's get started!

Preliminary steps


For this to work, you need to own a domain. How to get and set up a (free) domain is explained in detail in Part 1 of Creating a website on your VPS.

You don't need to follow that tutorial, but it is important to note that Freenom is very strict in their rules - they will delete your free domain if it doesn't point to a proper website (yes, that happened to me too). If for some reason you don't want a website, or can't set one up, your best option is to purchase a domain elsewhere (cost is around $10/year).

If you are using Freenom, you will need to point your naked/main domain (such as techperpexed.ga and/or www.techperplexed.ga) to an actual website, and then create the Plex server under a subdomain such as plex.techperplexed.ga.

It's probably easiest if you add a subdomain for Plex in your Freenom client area, see below.


Keep your client area open, you'll need to make more changes soon.

Setting up CloudFlare


In a new browser tab, create a free account with CloudFlare.


Click "Add Site", then type in your website and click "Begin Scan".


After the scan is complete, it should display a list of your imported records. If not, you will need to add them manually (in this case, create an A record with the name "plex" and point it to your VPS IP address).


Before you click "Continue", make sure all fields are gray except the subdomain you plan to use for Plex (once you verify things work, please make sure you change this later, but for now we don't want to complicate things). Just clicking the orange cloud should make it gray.

All set? Click "Continue". In the next step, I suggest you tick "Free Website" (unless you have money burning in your pocket), then click "Continue".


Next, you will be asked to change your nameservers. Make sure you make note of the exact two names you were given.


Now, go back to the client area of your domain provider. In the case of Freenom, click Manage Domain, Management Tools and select Nameservers.


Tick "Use custom nameservers (enter below)". Then change the first two lines with the information CloudFlare gave you, and remove line 3 and line 4. Then click "Change Nameservers".

Now, you may need to wait an hour or so for your service to propagate properly. Then, check CloudFlare. When you click "Overview", you should see if your status is set to "Active".


Before you exit the website, you will need to change two more things. First, click Crypto and make sure SSL is set to Full.


Next, click "Caching" and then click "Purge Everything" to start with a completely clean slate.


You can now click away your browser sessions and you can continue with Part 2 - Using CloudFlare with Plex.

Comments