DynamoDB Local: Address already in use (port 8000)
TL;DR — DynamoDB Local binds port 8000 by default, and something already holds it — an earlier DynamoDB Local you didn't stop, another service, or a duplicate serverless-offline/container. Either free port 8000 or start Local on a different port with -port (and point your client at it).
What it means
Exception in thread "main" java.net.BindException: Address already in use
... Failed to bind to port 8000DynamoDB Local is a Java process that opens a listening socket on port 8000. If that port is already bound, the JVM can't claim it and exits with BindException. It's purely a local port conflict — nothing to do with AWS or credentials.
Why it happens
- A previous DynamoDB Local is still running — a prior
java -jar DynamoDBLocal.jar(ordocker run) you never stopped. - Another service owns 8000 — a dev server, proxy, or unrelated app on the same port.
- Duplicate tooling —
serverless-dynamodb-localandserverless-offlineboth trying to bind 8000, or twodocker-compose upstacks. - A crashed instance left the port bound briefly (
TIME_WAIT), or a zombie container.
How to fix it
- Find what owns the port:
lsof -i :8000 # macOS / Linux netstat -ano | findstr :8000 # Windows (note the PID) - Stop that process (or the old DynamoDB Local):
kill <PID> # macOS / Linux taskkill /PID <PID> /F # Windows - Or run DynamoDB Local on a different port and update your client:
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -port 8001 # then: endpoint = http://localhost:8001 - Docker? Change the host side of the mapping (
-p 8001:8000) and connect to8001. - Remove duplicate plugins/stacks so only one process tries to bind the port.
Related errors
- Unable to start DynamoDB Local process — the emulator fails to start for other reasons (Java, native libs).
- Could not connect to DynamoDB Local (ECONNREFUSED) — the flip side: nothing is listening where you dial.
- Learn: Running DynamoDB Local