← All notes
domain, cloudflare, email, dns

Setting up a domain, website and email with Cloudflare

A guide for new companies and sole traders: buying a domain, DNS on Cloudflare, publishing a site via GitHub and a professional info@ email.

When you start a company or a sole trade, you need three things on the web: a domain, a website, and email on your own domain. These are three separate services that need to be connected. Here is the process I use for my own projects and for clients.

Buying a domain

You can buy a domain from any registrar. I usually use Hostinger, and for .hr domains there is the local registry. Through domene.hr, registered companies and sole traders are entitled to one free .hr domain, as long as the name is available and matches the registered business name. For a new business this is the logical first step.

It is important to understand that the registrar and the rest of the infrastructure do not have to live in the same place. The domain can be bought on one service, DNS managed on another, the website hosted on a third, and email on a fourth.

Why Cloudflare as the central place

DNS is your domain’s address book: it tells the internet where the website is and where the email goes. The registrar can manage it, but I move it to Cloudflare. The reason is practical: everything in one place. Cloudflare manages DNS, serves the website and provides basic protection and analytics, free of charge for what we need here.

The move is simple: add the domain in Cloudflare, it gives you two nameservers, and you enter them at your registrar in place of the existing ones. Cloudflare pulls in the existing DNS records on its own, so as a rule nothing gets lost. The change usually propagates across the internet within a few hours.

Website: GitHub + Cloudflare Pages

We keep the website in a GitHub repository and connect it to Cloudflare Pages. In Cloudflare you pick the repo, grant access and set the build commands (Cloudflare usually detects them on its own). From that moment, every push to the GitHub repo automatically publishes a new version of the site.

That means no manual copying of files to a server. You change the text, push, and it is online in a minute. For static sites this is the easiest way to publish that I know.

Email on your own domain

An address like info@yourdomain.com looks more serious than a Gmail address, and that is often the first impression a potential client gets. I opened the mailbox on Hostinger; other options are Zoho Mail, Purelymail or email hosting with local providers.

When you open the mailbox, the provider gives you a list of DNS records: MX records that say where your mail is delivered and a few TXT records. Paste them into Cloudflare DNS exactly as listed. Once the records propagate, email works.

What’s next

Those TXT records are not a formality: they decide whether your email lands in the inbox or in spam. More on that (SPF, DKIM and DMARC in plain language) in the next post.