Senthilsweb
Search
Blog

How to expose apps running in your home lab server securely to public internet thru cloudflare tunnel?

This post will guide you to expose your local development websites and webhooks or any http applications running in your home servers to public internet in a safe and secure manner using free Cloudflare (cloudflared) tunnel client also known as Argo Tunnel. It is 100% free and doesn’t requre any registrations or Credit card details.

Use cases

Common usecases where tunneling softwares will be handy

Architecture

cloudflared is command-line client for Cloudflare Tunnel, a tunneling daemon that proxies traffic from the Cloudflare network to your origins. This daemon sits between Cloudflare network and your origin (e.g. a webserver) as shown in the network architecture diagram.

background

Getting Started

Download cloudfalred tunnel client

Installation

cd into the folder where your downloaded cloudflared

cd [path where your downloaded cloudflared]/

Run the tunnel pointing to your local website url. In my case, I am running grafana in a docker container at port 3000

./cloudflared tunnel --url http://localhost:3000

Cloudflared Features

Cloudflared shortcomings

The cloudflared tunneling client doesn’t support non http protocols (i.e. tcp). E.g. expose MS SQL Server or PostgreSQL dabases running your local.

Alternate softwares

ngrok supports both http and tcp however the free version supports just one instance of ngrok.

Expose MS SQL server running in your local machine at port #. 1433

./ngrok tcp 1433

References: