Home How to publish local web project to the internet
Post
Cancel

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

http://localhost: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

1
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

1
docker container inspect mycontainer

Run the following command to publish it

1
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