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.
Serverless and test runners
The serverless-dynamodb-local plugin and Jest globalSetup hooks often start
Local implicitly — if you also run docker run -p 8000:8000 amazon/dynamodb-local
manually, the second bind attempt dies with BindException even though Local is
already healthy. Pick one launcher per machine session.
On macOS, orphaned Java processes from an IDE test runner are a frequent culprit
— lsof -i :8000 often shows java with a PID from an earlier Gradle run.
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.
In DynoTable
After freeing port 8000 (or moving Local to -port 8001), install DynoTable
and add a Local profile in Settings → Profiles → Add Profile: set endpoint
http://localhost:8000 (or your alternate port), a placeholder region, and
alphanumeric dummy credentials. Test Connection confirms the emulator is
listening before you browse tables. Walkthrough:
Running DynamoDB Local ·
Connect to DynamoDB Local & LocalStack.
When you change ports, update the profile endpoint to match — a profile still
pointing at :8000 while Local listens on :8001 produces
connection refused even
after the bind conflict is resolved. The DynamoDB JSON converter
helps load seed data once Local is reachable.
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
Sources
- Deploying DynamoDB locally on your computer — AWS DynamoDB Developer Guide (default port 8000; "If port 8000 is unavailable, this command throws an exception")
- DynamoDB local usage notes — AWS DynamoDB Developer Guide (the
-portcommand line option and full flag list) - amazon/dynamodb-local — Docker Hub (official image and port mapping)