Uncategorized

Self-Hosting Rails hobby apps – the Cloudflare tunnel was an enabler for me

“`html





Taking Back Control: Self-Hosting My Rails Apps with Cloudflare Tunnels

Taking Back Control: Self-Hosting My Rails Apps with Cloudflare Tunnels

Okay, let’s be honest. I’ve spent *way* too much time wrestling with hosting setups. I’ve bounced between shared hosts, managed cloud providers, and honestly, just felt completely lost in the weeds. The thought of self-hosting my little Rails hobby projects always seemed daunting – a tangled mess of ports, SSL certificates, and DNS records. But then I stumbled across Cloudflare Tunnels, and suddenly, it felt… manageable.

I recently read a fantastic post by /u/Signal-Shoe-6670 on Reddit about his experience using Cloudflare Tunnels for self-hosting. It really resonated with me, and I wanted to share his story – and my own – to show you how easy it can be.

The Problem Before Cloudflare Tunnels

For a while, I was running a few small Rails applications – mostly just prototypes and experiments. I’d push code to a basic hosting provider, and it worked… mostly. But there were always these little nagging frustrations. Setting up SSL was a pain. Keeping my DNS records updated felt like a constant chore. I’d spend ages configuring port forwarding, which always seemed overly complicated. It felt like I was paying for a service I wasn’t really utilizing, and honestly, it was draining my time and energy away from actually building.

The worst part was the feeling of being locked in. Switching hosts felt like a massive undertaking. I was trapped in a system that, frankly, didn’t seem to understand my needs.

How Cloudflare Tunnels Changed Everything

Cloudflare Tunnels is basically a secure, encrypted tunnel that connects your home network to the Cloudflare network. It handles all the complicated networking stuff for you. And the best part? It’s incredibly simple to set up.

Here’s the gist of what I did (and what Mark Holton described so well in his post): I used a Mac Mini M2 (you could use whatever server you’re comfortable with – Docker is a great option too) to run my Rails applications. Then, I installed the Cloudflare Tunnel app. Within 30 minutes, I had my apps running behind a secure, encrypted tunnel.

Let’s break down the key benefits:

  • No Port Forwarding: Seriously, gone!
  • Automatic SSL: Cloudflare handles the certificates for you – no more fiddling with Let’s Encrypt or renewals.
  • Dynamic DNS (Built-in): Cloudflare manages your DNS records automatically.
  • Enterprise-Grade Security: This is a big one. Cloudflare’s global network provides DDoS protection and other security features – all for free!

It’s just… *works*. And that’s the most surprising thing. I could finally focus on building features for my apps instead of stressing about the underlying infrastructure.

My Setup – A Quick Walkthrough

Mark Holton’s post has a great walkthrough here: https://dev.to/mark_holton/selfhosting_rails_apps_with_cloudflare_tunnels_why_i_ditched_17month_cloud_hosting_for_a_599_4epo. Seriously, check it out!

Basically, it involves:

  1. Installing the Cloudflare Tunnel app on your server.
  2. Configuring the tunnel (which is surprisingly straightforward).
  3. Deploying your Rails app.

Why I Think You Should Try It

I’m not saying this is a magic bullet for everyone. But if you’re like me – someone who gets overwhelmed by the complexities of hosting – Cloudflare Tunnels is a fantastic option. It’s incredibly affordable (the free tier is perfectly adequate for hobby projects), it’s secure, and it frees you up to focus on what really matters: building cool things.

And remember, Cloudflare’s enterprise-grade security is included – which is mind-blowing for the price. It’s a great entry point into self-hosting without the usual headaches.



“`

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Appliance - Powered by TurnKey Linux