coolify icon indicating copy to clipboard operation
coolify copied to clipboard

[Bug]: WebSocket connection fails when accessing Coolify via HTTPS - Terminal and real-time features not working

Open DigiRift-frontend opened this issue 7 months ago • 1 comments

Error Message and Logs

Description After a server reboot, Coolify's WebSocket connections fail when accessing the UI via HTTPS. The terminal feature and real-time updates are not working. The browser console shows repeated WebSocket connection failures. Environment

  • Coolify Version: 4.0.0-beta.418
  • Installation Method: Docker
  • OS: Ubuntu (Linux)
  • Browser: All browsers tested

Current Behavior When accessing Coolify via HTTPS, the following errors appear in browser console: WebSocket connection to 'wss://admin.domain.com:6001/app/cffeaf583e1404e00276097c0e104e9f19582edb08d65d4a4e6bf23e567788ba?protocol=7&client=js&version=8.3.0&flash=false' failed

The UI shows: "WARNING: Cannot connect to real-time service"

Expected Behavior WebSocket connections should work over HTTPS as they did before the server reboot. Terminal access and real-time updates should function normally.

Docker Container Status

bash# All containers are healthy and running
coolify           - Up About an hour (healthy)
coolify-realtime  - Up 7 minutes (healthy)  # Note: This container restarts frequently
coolify-db        - Up 13 days (healthy)
coolify-redis     - Up 13 days (healthy)
coolify-proxy     - Up 2 hours (healthy)

Relevant Logs Browser Console:

javascript[Terminal] WebSocket connection established. Cool cool cool cool cool cool.
[Terminal] WebSocket connection closed.
WebSocket connection to 'wss://admin.domain.com:6001/app/...' failed
[Terminal] Attempting to reconnect...

coolify-realtime logs show repeated restarts:

2025-06-11 15:15:03 [TERMINAL] Coolify realtime terminal server listening on port 6002. Let the hacking begin!
2025-06-11 15:16:00 [TERMINAL] Coolify realtime terminal server listening on port 6002. Let the hacking begin!

Configuration Details

The container was started with these environment variables:

bash
PUSHER_HOST=admin.domain.com
PUSHER_PORT=6001
PUSHER_SCHEME=http
APP_URL=http://admin.domain.com:8000
What I've Tried

✅ Verified port 6001 is accessible: Connection to admin.domain.com: 6001 port [tcp/x11-1] succeeded! ✅ Recreated containers with proper environment variables ✅ Checked that all services are healthy ❌ WebSocket still tries to connect via wss:// (secure) to an http:// endpoint

Steps to Reproduce

  1. Access Coolify via HTTPS (https://domain.com:8000/)
  2. Navigate to any application
  3. Click on "Terminal" tab
  4. Observe WebSocket connection failures in browser console

Example Repository URL

No response

Coolify Version

v4.0.0-beta.418

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

No response

Additional Information

No response

DigiRift-frontend avatar Jun 11 '25 16:06 DigiRift-frontend

How come that you connect to coolify via https://domain.com:8000 instead of just https://domain.com? If you set up the Instance Domain under Settings you don't need to add the port at the end of the URL anymore, as you would access coolify through the proxy. As long as the proxy is running at least.

Cinzya avatar Jun 12 '25 22:06 Cinzya

I have the same, my terminal window (in Coolify) closes immediately after showing a warning. From Chrome's Dev Tools, two WS related: [email protected]: Permission denied (publickey,password). and Warning: Identity file /var/www/html/storage/app/ssh/keys/ssh_key@kw8g0c0o80kc40cg0cwkssk0 not accessible: No such file or directory. My comments:

  • user used to SSH: root@ip, when error shows root@domain format: properly handled in Coolify?
  • on my VPS there's no such folder and file like in warning: var/www so I think it should be created by Coolify.

Coolify: v4.0.0-beta.420.6, docker compose used, with realtime, so ports 6001, 6002 are working on a Windows 10 with WSL

VPS: Ubuntu 24

vanetreg avatar Aug 31 '25 18:08 vanetreg

That folder references the location inside the Coolify container. On WSL you want to look for it under /data/coolify/ssh/keys

Cinzya avatar Aug 31 '25 19:08 Cinzya

Closing this issue for now as we haven't received a response from OP anymore after a significant amount of time. We can re-open this issue if anyone else is facing the same issue again,

Cinzya avatar Nov 02 '25 00:11 Cinzya