Home How to publish local web project to the internet

How to publish local web project to the internet

While developing project locally, sometimes I would like to publish them for client testing or having quickly demonstration. The local project is running on port 8080


Thanks to cloudflared that we can use to publish it to the internet easily with a simple single command.

Using binary cloudflared

We have to download the binary cloudflared and execute this command

cloudflared tunnel --no-autoupdate --url http://localhost:1337

Using docker image cloudflare/cloudflared

In case I want to publish a web project running on a container names mycontainer

Check which’s network & IP address mycontainer is running on

docker container inspect mycontainer

Run the following command to publish it

docker run --rm --network=network_name cloudflare/cloudflared tunnel --no-autoupdate --url http://container_ip:8080
This post is licensed under CC BY 4.0 by the author.

Some useful docker commands

Use OpenSSH in Windows