It seems like you're using a local IP address. How would CloudFlare access it? Not an expert, but seems wrong to me.
Cloudflare Tunnel is a free ngrok.io alternative.
The value of the hostname is the domain (e.g. demo.traccar.org).
- hostname: track.mydomain.com
service: http://192.168.0.251:8082
- hostname: devices.mydomain.com
service: http://192.168.0.251:5055
- service: http_status:404
The track.mydomain.com is the URL for the web interface. [Accessible via internet]
The devices.mydomain.com is what I put in the Server URL on the Traccar Client. [Accessible via internet]
I chose Cloudflare Tunnel over ngrok.io because Cloudflare Tunnel provides a custom domain for free. Unlike ngrok.io, you need to pay 5 USD/month for the custom domain.
I also asked their community regarding my issue (still waiting for their reply). I will share the solution once I solve it.
Thanks for replying, @Anton! :)
Is it software that runs on the same server? Wouldn't you just use localhost in that case instead?
I run the Cloudflare Tunnel software on a separate Ubuntu Server 20.04 LXC Container.
Traccar has also its own Ubuntu Server 20.04 LXC container.
The Traccar Client on Android detected port 5055 as online, but can't send the device's location. It's really weird. Maybe Cloudflare blocks the communication between the Client and the Traccar Server via Tunnel.
12:07:56 AM - Network Online
12:07:56 AM - Location Update
12:07:56 AM - Send failed
My Internet Subscription Plan is behind CGNAT, that's why I use a tunneling service to expose my servers to the internet.
Hi @Nv3#6xP%%WuJoYM7 , did you find the solution for this issue. I have the exact same thing to implement
Jelou... any solution?
CF Tunnels on TCP work only with cloudflared access ou cloudflared tunnel --url tcp://.... Since this proxy setup can't be done in the gps devices, one can not use CF tunnels to protect Traccar protocol ports.
You could use it instead to protect the Traccar http port.
If Traccar had some way other than ports to distinguish protocol traffic, like paths or something, CF Tunnels could be used.
ports:
- 5000-5150:5000-5150/tcp
- 5000-5150:5000-5150/udp
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
labels:
- traefik.enable=true
# Roteador HTTP (redireciona para HTTPS)
- traefik.http.routers.traccar-http.rule=Host(`YOUR_DOMAIN`)
- traefik.http.routers.traccar-http.entrypoints=web
- traefik.http.routers.traccar-http.middlewares=redirect-to-https
# Middleware para redirecionar HTTP → HTTPS
- traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https
# Roteador HTTPS
- traefik.http.routers.traccar.rule=Host(`YOUR_DOMAIN`)
- traefik.http.routers.traccar.entrypoints=websecure
- traefik.http.routers.traccar.tls=true
- traefik.http.routers.traccar.tls.certresolver=letsencryptresolver
# Serviço interno (porta do Traccar)
- traefik.http.services.traccar.loadbalancer.server.port=8082
- traefik.http.services.traccar.loadbalancer.passHostHeader=true
Configure o DDNS ou IP público do seu servidor nesse registro.
Utilize um DDNS (Ex. No-IP) e configure no roteador ou no servidor
No Cloudflare, crie um subdomínio CNAME separado, ex:
CNAME / gps / YOUR_DDNS
Marque esse DNS como “DNS only” (ícone cinza) — sem proxy Cloudflare.
Os dispositivos devem conectar-se a:
Host: gps.YOUR_DDNS
Port: 5055
Hello guys!
So I have an Ubuntu 20.04 LXC container, running at Proxmox Platform. I installed the
traccar.runand it was fine. No errors.But Cloudflare Tunnel responded



502 Bad GatewayError.Screenshot Error:
Here's my configuration:
Traccar Client Logs on Android:
The localhost is working fine. Is it me that has errors or it's Cloudflare?
Thank you.