⬅ Back

DIY Cloud Wizard 🪄

aws at home

Ever wanted to host your apps running on localhost straight to the internet?
Be careful—now you won’t be able to say “it works on my local”.

Because sometimes localhost:3000 just isn’t spicy enough. 🌶️


🧙‍♂️ What You’ll Need to Channel Your Inner Tech Sorcerer


1️⃣ Register Your Domain with Cloudflare

(AKA Claim Your Internet Throne)

First things first—register your domain with Cloudflare.

You can use Cloudflare’s documentation and follow the instructions.

Once you hook it up, it’ll show up in your Cloudflare dashboard.

Congrats 🎉 Step 1 complete!
success


2️⃣ Install Cloudflare Tunnel

(Your Secret Underground Passage)

Now it’s time to install Cloudflare Tunnel.
This acts as a hidden passageway between your computer and the internet.

Check Cloudflare’s docs for setup.
When you run cloudflared for the first time, it:

You’ll use this config file to define ingress rules (where traffic should go). It will look something like this.

ingress:
  - hostname: my-awesome-project.myDomain
    service: http://localhost:1000
  - service: http_status:404

3️⃣ Tweak Your DNS Records

(The Secret Handshake of the Internet)

This is where you say:

“When someone visits mycoolapp.mydomain.com, send them to port 3000 on my computer.”

How? By tweaking your DNS records in Cloudflare.

Steps:

  1. Open your Cloudflare dashboard → Select your domain → Go to DNS Records.
  2. Add a CNAME record for your subdomain.
    • Name → your subdomain (e.g. app)
    • Target<YOUR_TUNNEL_ID>.cfargotunnel.com
  3. You’ll find the tunnel ID in the credentials file Cloudflare generated.
  4. Set Proxy Status to Proxied.

That’s it—now the world knows where to find your localhost.

dns


4️⃣ Fire Up the Tunnel and Watch the Magic Happen

Run cloudflared on your system and boom—your tunnel is alive ⚡.

Start your project locally (Node.js app, Flask server, portfolio site… whatever).
Cloudflare Tunnel takes care of the rest.

Visitors → Your subdomain → Cloudflare Tunnel → Your local server.
It follows the ingress rules you defined and routes traffic correctly.


5️⃣ Go Full Automation Freak 🛠️

If you’re like me, you’ll want to automate everything.

Check out Migaku—a simple script I use to:

How it works:

automate


💠 Side Quest: The Rune-Keeper (Environment Variables)

I keep a separate repo for environment variables:

Yes, I’m literally storing my env files on GitHub.
But don’t worry—it’s secure: AES-256 encryption with one password stored only in my brain 🧠.
Without the password, the .enc files are useless.

offline


🎉 And Voilà! You’re a Self-Hosting Superstar

With Cloudflare Tunnel, your projects are:

All from your own computer—no cloud bills, no corporate overlords.

So go forth, show off your work, and let the internet bask in your brilliance.

leo