Pointing Cloudflare to Cloud VPS

Pointing Cloudflare to Cloud VPS

In my previous post, I provided a tutorial on how to pointing a domain to Cloudflare. This time, I’ll be sharing how to point a domain that has already been registered with Cloudflare to a Virtual Private Server (VPS).

Here are a few things you need to prepare:

  1. A domain registered with Cloudflare

  2. A Virtual Private Server (VPS)

VPS

Before we begin, let's get to know a bit about a Virtual Private Server (VPS). A VPS is a physical server that is divided into several virtual servers. Each VPS is used privately, meaning all of its resources are dedicated to a single user. In this case, we will be using a Cloud VPS.

Without further a do...

Step 1

Make sure you know the public IP address of your VPS. In this case, I have purchased a Cloud VPS with Ubuntu as the operating system. I will share how to set up the VPS in the next article.

VPS dashboard

From the dashboard above, I can find the public IP address of my VPS. When I type it into a browser, the result will look something like this.

Homepage VPS

The image above shows the main display of the VPS when accessed using the public IP address. The VPS has been configured with Nginx as the web server and Next.js as the landing page. We'll discuss the VPS configuration in more detail in the next article.

Step 2

Please log in to your Cloudflare account. Select the domain you registered, then go to DNS > Records, and click on Add Record.

After successfully navigating to the DNS Records page, click on Add Record, and you will be prompted to fill in several fields:

  • Type: This is the type of record you want to register. Choose A.

  • Name: Enter the location of the domain. For the root domain, use @, and for a subdomain, enter the subdomain's address.

  • IPv4 Address: This is the target field for the root domain. Enter your VPS's IP address in this field.

  • Proxy Status: This is a feature provided by Cloudflare that allows your address to be masked by a proxy. Disable this option if you're confident that your VPS is secure enough.

Add A record

After completing the setup, click Save. If everything is done correctly, your domain will be successfully pointed to your VPS.

Access VPS using domain

In conclusion, pointing a domain registered in Cloudflare to a VPS is a straightforward process that enhances your control over your web hosting environment. By configuring the DNS records correctly, you can direct traffic from your domain to your VPS, ensuring that your website is accessible via the public IP of your server. Remember to ensure your VPS is properly secured and configured, as the proxy feature in Cloudflare can be disabled if you're confident in your server's security. With everything set up, your domain will now be seamlessly connected to your VPS, ready to serve your content.