In one of my IT training classes, I was recently asked about how to secure a custom domain (e.g. gunnaraas.com), set up a simple website, and set up email services. This is something I did early on in my career, largely as a “because I can”, and that I’ve received positive feedback on from potential clients and employers.

There are, of course, ways of spending hundreds of dollars a year to accomplish this in a one-click deployment (GoDaddy, Squarespace, Google Workspace, etc.), but in my opinion, that’s completely unnecessary unless you have a real business case for that expense. For a simple portfolio page and email address to list on job applications, why not keep it as cheap as possible?

The aim of this blog post is to lay out what I’ve done to set up my domain and associated services.

Getting the domain name

For most of my domains, I utilize Google Domains as my registrar. Their offerings are reasonably priced, with no unnecessary upsells, etc. Search for an available domain that works for you, add to cart, and check out. One that works for these purposes should cost no more than $10-20/year, this being your only recurring cost for this project.

As you’re looking at available domains, consider what the TLD (.com, .org, .net) might convey to the person on the other side of your emails. I shy away from domains like: .info, .biz, .us, and .net.

Note:
Learn from my mistakes, and stay away from .us domains, as well as any others that do not allow for domain privacy (showing the registrar’s address, phone number, etc. instead of yours). If you buy one of those, you’re giving away your contact information to shady web development firms who will never stop cold calling you, even after the domain expires.

Once you’ve completed this step, you’ll have access to the DNS settings, which you’ll need for future steps.

Optional: Set up Cloudflare CDN

I manage all my DNS settings through Cloudflare, and also use their free CDN and DDOS protection services, which help increase the uptime of your website and other services hosted through your domain by preventing malicious traffic from accessing your server. If you decide to self-host any services at home (on a Raspberry Pi, an old computer, or a decomissioned server), there are also plenty of free scripts available to automatically check and update DNS records, great for residential internet users who lack a static IP.

The “Add a Site” wizard to get started with Cloudflare is very straightforward and easy to use. You must simply sign into Google Domains, change your Nameserver (NS) record on your new domain from Google to Cloudflare, and wait 15-30 minutes for the changes to propagate across the internet. Any DNS records you had in Google will be copied into Cloudflare, meaning zero downtime for any existing services. Once this is done, you will be able to edit your DNS inside of the Cloudflare admin panel.

You may also want to transfer your domain to Cloudflare Registrar. This is a service that reduces your annual domain renewal fee to only that charged by ICANN (the internet name authority), which is slightly cheaper than that of Google. This .com is ~$8/yr on Cloudflare vs. $12/yr on Google Domains. The only downside is that, last I checked, the service is limited to traditional TLDs (.com, .org, net), and newer gTLDs (.xyz, .app, .fun, .ninja) are unsupported.

Settings up a simple website

For a personal website, which you might use as a project portfolio, or to host a blog, the content will be fairly static, and generally doesn’t require the processing power provided by a dedicated web server. Instead, you can generate your website once, then host it using free services like GitHub Pages or Netlify.

To do this, you’ll use a static site generator. I’m a fan of the tool Hugo. As long as you’re familiar with interacting with your command line, and are not afraid of editing the website configuration files in Markdown or YAML (easy enough for beginners), you should be fine. There are great community-made themes available to make getting started easy.

Follow the instructions available on Hugo’s Getting Started wiki page. To install the software, create a new site, add a theme, add content, and build your static website.

To get this available online, you have two main options:

  1. Once configured, build your site using the command hugo, and copy the files in the ./public folder to a GitHub repository set up for GitHub pages (generally, <yourusername>.github.io).

    To configure your domain, set a CNAME record in Cloudflare: CNAME <yourdomain> <yourusername.github.io. Your website will then act as a proxy for the pages on GitHub.

    While the most straightforward option, making changes to your site in this format can be frustrating. This can be made easier using automation.

  2. The other option is to publish the build files (everything in the folder containing your content and configuration files for Hugo) for your website to a GitHub repository, then link it to a service (such as Netlify) that will automatically monitor the repository for changes, then rebuild and host the HTML files on their servers. This makes changes easy and automated, and ensures that you will never break your website due to a bad configuration. This is my preferred mode of using static site generators, and the way that this blog is built.

The respective services offer excellent guides and documentation about how to use their tools for this purpose. The most likely pain point here will be configuring your computer and text editor to use Git.

Setting up email on a custom domain

Microsoft 365 Developer Program

The Microsoft 365 Developer Program is a excellent program offered by Microsoft to allow interested users to create a O365 domain for learning and testing purposes, without worrying about the expensive associated monthly fees. While not a supported use case of the program, you can link your domain name to this and use Outlook as if it were a real business account. The only caveat here is that you must sign in every 90 days, or your account and emails will be deleted. There is also a risk that this program will be discontinued in the future, and that this technically violates the ToS and intended use case of the program.

Namecheap Email Hosting

The next best option I’ve found for custom domain email is Namecheap Premium Email. It’s not free, but at $10/year is significantly cheaper than other offerings (Google and Microsoft are $72+/year at minimum). The webmail client is not as nice, but it gets the job done.

Once you have selected and signed up for a email program, sign into Cloudflare to configure it in your DNS settings according to the instructions on their website. You will need to add MX, CNAME, SRV, and TXT records to send and receive mail, and so that your outgoing emails are not flagged as spam.

Other potential options?

Cloudflare Email Routing (beta) is a service that looks promising, which allows you to have an unlimited email addresses ([email protected], [email protected], [email protected]), but forward all inbound messages to your free webmail account ([email protected]). I have not tested this specific service yet, but have been very impressed with all the Cloudflare tools I’ve used in the past. This could be a interesting option for receving inbound messages, but as far as I can see, doesn’t currently allow for outgoing mail to be sent.