Loading...

Postulate is the best way to take and share notes for classes, research, and other learning.

More info

Deploying to custom Google Domain using Railway App and Cloudflare

Profile picture of Samson ZhangSamson Zhang
Aug 17, 2022Last updated Aug 17, 20222 min read

Vercel has an amazing CI/CD flow, but it's slow for low-traffic webapps due to its serverless nature. Zeet replicates Vercel's CI/CD on a much faster VPS at the cost of $5/month -- until a few months ago, when they changed their business model and such a simple deployment is no longer possible.

For a little bit I manually deployed Postulate to a DigitalOcean droplet. This replicated the performance and pricing of my Zeet VPS, but without any of the CI/CD automation, making deploying new updates a massive pain.

Eventually I asked on Twitter about Zeet replacements and was recommended railway.app. With really nice CI/CD and usage-based pricing for VPS-style hosting, it seemed to be exactly what I was looking for, and I quickly threw Question Journal and Updately up on it.

But I ran into a little bit of a problem when trying to connect my Updately deployment to my Google updately.us domain. Unlike other hosting providers, Railway requires a CNAME record pointing "@" to "updately-production.up.railway.app", while unlike other domain registrars, Google Domains doesn't support "@" CNAME records.

The solution is to set up a Cloudflare proxy to create this CNAME record. Here's how to do that.

1. Create a new site in CloudFlare

Create a CloudFlare account, then hit the "add a site" button and add your domain name.




Select the free plan for the site when prompted.

2. Delete existing DNS records and create new CNAME record

Once you add your site, Cloudflare will find existing DNS records. First, delete all of them.



Then create a new CNAME record pointing to your railway.app link.



3. In Google Domains, change your name servers to Cloudflare's

Once you set up your DNS records Cloudflare should prompt you to change over to their name servers.

To do this in Google Domains, go to DNS, then "Custom name servers". Add the Cloudflare name servers, hit save, then hit "Switch to these settings" at the top.



And that's it! These changes will take some time to propagate, but hold tight and soon your Railway app should be up and running on your domain.


Comments (loading...)

Sign in to comment

Postulate

Founder and dev notes from building Postulate