Connection Failures
This page covers errors you encounter when your client cannot reach the TerminusDB server — the server is not running, the port is wrong, Docker networking is misconfigured, the browser blocks the request due to CORS, or the connection times out.
Symptoms
ECONNREFUSEDorConnection refusedin your terminalfetch failedorNetworkErrorin the browser consoleCORS policy: No 'Access-Control-Allow-Origin' headererror in the browser- Request hangs indefinitely and eventually times out
getaddrinfo ENOTFOUNDwhen using a hostname
Common causes
Server not running
Error message: connect ECONNREFUSED 127.0.0.1:6363
Cause: TerminusDB is not started, or the Docker container has exited.
Fix:
- Check if the container is running:Example: Bash
docker ps | grep terminusdb - If nothing appears, start the container:Example: Bash
docker start terminusdb - If the container does not exist, create it:Example: Bash
docker run -d --name terminusdb \ -p 6363:6363 \ -v terminusdb_storage:/app/terminusdb/storage \ terminusdb/terminusdb-server
Wrong port or host
Error message: connect ECONNREFUSED 127.0.0.1:6364 (or any non-6363 port)
Cause: Your client is pointing to a port that TerminusDB is not listening on, or you are using localhost when the server is on a different host.
Fix:
- Confirm the port mapping:You should seeExample: Bash
docker port terminusdb6363/tcp -> 0.0.0.0:6363. - Update your client connection URL to match the mapped port.
- If running inside another container, use the container name or Docker network IP — not
localhost.
Docker networking (container-to-container)
Error message: getaddrinfo ENOTFOUND localhost or ECONNREFUSED from within another container
Cause: When two containers need to communicate, localhost inside a container refers to that container itself, not the host machine.
Fix:
- Put both containers on the same Docker network:Example: Bash
docker network create terminusdb-net docker network connect terminusdb-net terminusdb docker network connect terminusdb-net your-app - Use the container name as the hostname:Example: Text
http://terminusdb:6363 - Alternatively, on Docker Desktop, use
host.docker.internalto reach the host:Example: Texthttp://host.docker.internal:6363
CORS errors from the browser
Error message: Access to fetch at 'http://localhost:6363' from origin 'http://localhost:3000' has been blocked by CORS policy
Cause: TerminusDB unconditionally allows all cross-origin requests — it reflects back whatever Origin header is sent. If you are seeing a genuine CORS error, the most common causes are: a browser extension blocking requests, a proxy stripping CORS headers, or connecting to a different host than you think (e.g., the wrong port).
Fix:
- Confirm TerminusDB is actually running and reachable at the expected URL:You should see
curl -s http://localhost:6363/api/ok"ok". If not, the server is not running — see Server not running above. - Check your browser's network tab for the actual request URL and response headers. If
Access-Control-Allow-Originis missing, the request never reached TerminusDB (firewall, proxy, or wrong URL). - There is no
TERMINUSDB_CORSenvironment variable — do not set one. See Calling TerminusDB from the Browser for a working fetch example.
Connection timeout
Error message: timeout of 5000ms exceeded or request hangs with no response
Cause: A firewall, VPN, or misconfigured network is preventing packets from reaching the server. The server may also be under heavy load.
Fix:
- Verify basic connectivity:A healthy server returns
curl -s -o /dev/null -w "%{http_code}" http://localhost:6363/api/info200. - Check firewall rules are not blocking port 6363.
- If behind a corporate VPN, ensure local traffic is not being routed through the tunnel.
- Increase the client timeout as a temporary workaround:Example: JavaScript
const client = new TerminusClient.WOQLClient("http://localhost:6363", { user: "admin", key: "root", })
Still stuck?
- Open an issue with the full error message and your Docker/environment details
- Check the Installation guide for Docker setup instructions
- Check the TerminusDB CLI reference for server management commands