Cloudflare Tunnel will only stay active if I keep Putty open

I’m not going to lie, I’m using Docker for the first time so this could be a noob mistake on how I have it setup. Anyways I have a VM running Docker and I had a tunnel setup and working for a few days. Recently I checked the health and it said it was down. Tried recreating the tunnel and removing/readding the container in Docker and it seems like the install never finishes.

Basically I copy that CLI for Docker, paste it into Putty, hit enter, and then my tunnel shows healthy, but as soon as I close Putty, service goes down and the container isn’t installed.

I tried again and this time directly from the VM and it looks like it doesn’t complete but the tunnel health is unhealthy and when I try accessing the site, it says “unable to reach the origin service, the service may be down or it may not be responding to traffic from cloudflared”…“connection refused”. On the phone side when I tried that it gave me a 502 error bad gateway.

I’m lost, please, any advice is greatly appreciated.

possibly cloudflared tunnel s running in the putty session, when you close putty the session also closes, search “How to start a docker container as daemon process”

I ran it from the VM instead. It’s just sitting there with _ so idk if that means it didnt finish but at least I dont have to keep putty open. It says healthy but says unable to reach the origin service.

what is your origin service? is it available at the end of the tunnel. like if it’s a website then the site bindings on your web server have to match that port and name which you have setup on the Cloudflare

yes its a website. And the ports match on the tunnel

hum, okay, just a shot in the dark from one of my previous issues… wondering if maybe there is some additional config needed for the VM to allow this

there are sometimes firewalls on the VM, or even the VM host that need to allow communications.


I assume that you copy the command on the dashboard, you need to add “-d” next to “run” so the container can stay up.

Now it run but after you close your console (putty) the container shutdown as well


try the “docker run -it” it may be what is needed

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.