While I am proud of this site, it is still very much in its early stages. If you could not already tell, it was originally just static HTML hosted on GitHub Pages. Last night, I finally took the time to self host my website. Now drumroll please it is a static HTML site hosted on an Oracle VM! (WOW!)

Why Self Host? Is GitHub Pages Not Good Enough?

Yes, GitHub Pages is perfectly fine for what my site currently is. Future changes and the desire to learn motivated me to switch. Sometimes wanting to learn is a good enough reason.

So What Did This “Great Migration” Involve?

Surprisingly, not a whole lot. The process was easier than I expected.

Step 1: Choosing a Machine To Host Your Website

To host a website, you need an actual machine serving your files. You can technically host a site from a personal laptop, but it will not be reliable and it will not have proper uptime. A cloud server is a much better choice.

Since I did not want to pay for hosting and this site is not exactly the center of the internet, I used the Oracle Cloud “Always Free Tier.” It provides a Linux VM with a public IP, which is perfect for pointing your domain to. If you want to see it for yourself, check out Oracle Free Server.

Step 2: Pointing Your Domain to the Correct IP

Most people buy their domain from places like Namecheap. They give you DNS tools so you can point your domain to your server’s public IP. DNS propagation can take 24 to 48 hours, but it often finishes much faster. Once it completes, running dig on your domain should return your VM’s public IP.

Step 3: Updating Your Server Networking

This step varies depending on the cloud provider and operating system. The general idea is that you must allow incoming TCP traffic on the ports your website will use.

Important ports:

  • 80 for HTTP
  • 443 for HTTPS

On Ubuntu, I used iptables to allow these ports. Once the rules are in place, you can test your setup by curling or pinging your public IP to confirm the server is reachable.

Step 4: Adding Server Processing

This guide assumes your site is like mine. It is static HTML generated by Jekyll. In that case, hosting is simple.

This is where NGINX comes in. It is pronounced “Engine X” so you do not embarrass yourself like I did. NGINX is a web server that handles incoming requests. In this setup it works like this:

  1. A client sends an HTTPS request
  2. NGINX handles the TLS handshake
  3. NGINX decrypts the request
  4. NGINX serves the correct static HTML

That is the entire flow.

Step 5: Optional Webhooks

I had never used webhooks before, but since my website is stored in a GitHub repo, it would be nice if my server automatically pulled new changes whenever I pushed updates.

That is exactly what GitHub webhooks allow. My Oracle VM listens on port 9000 for GitHub webhook events. Whenever I push to the repo, the server does the following:

  1. Receives the webhook
  2. Pulls the latest version
  3. Copies the static HTML to the serving directory
  4. NGINX serves the updated site immediately

This step is not required, but it definitely improves the workflow.


Conclusion

This entire process taught me a lot about what self hosting actually involves. Even though this site is simple, the same general steps apply to almost any website, regardless of complexity. I am excited to keep hosting my own projects and continue learning more about computer science.

What Is Next?

Such is always the question from my mentor Travis (Do You Need A Task? ☠️). My next plan is to build a C++ backend using Crow. Yes, I am intentionally using C++ for my backend. Do not ask me to use Rust. I want to turn it into a weekly newsletter system for this site.

I also want to keep exploring lower level topics like operating systems and compilers. I found some great video series on both and plan to implement projects in those areas.