dynamo db local shell doesn't list tables using docker image
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
When DynamoDB Local runs in Docker but list-tables returns nothing, the problem is usually endpoint targeting, container networking, or data persistence location. The DynamoDB process can be healthy while the client points to a different instance. This guide walks through a reproducible setup and the checks that usually resolve the issue quickly.
Run DynamoDB Local in Docker
Start a container with explicit port mapping and a persistent volume.
The -sharedDb option simplifies local development because all credentials map to one local database file.
Use Correct AWS CLI Endpoint
Without --endpoint-url, AWS CLI talks to cloud DynamoDB, not your local container.
Create a test table and list again:
If table creation succeeds but listing still appears empty, you are likely hitting different endpoints across commands.
Verify Container Health and Port Mapping
Confirm container status and mapped ports.
If port mapping changed, update your client endpoint. If container restarts frequently, check Docker logs for file permission issues on mounted volume paths.
Diagnose Networking from Another Container
If your app runs in another container, localhost inside that container points to itself, not DynamoDB Local.
Use Docker network names instead:
In docker-compose, set both services on one network and reference service name as host.
Check Persistence and Data Location
If tables disappear after restart, data is not persisted. Mount a host folder and pass -dbPath to keep state.
Also ensure your local shell is not mixing in-memory mode in one run and file-backed mode in another. That creates confusing behavior where tables seem to vanish.
Reproducible Local Setup with Compose
Using docker-compose reduces command drift across team members and CI environments. A simple service definition keeps port mapping and startup options consistent.
After startup, run table operations against http://localhost:8000. Keep helper scripts in the repository for create-table and list-tables commands so everyone uses identical endpoints. Standardizing setup removes many false troubleshooting paths caused by per-machine command differences.
CLI Profile Isolation
Use a dedicated local AWS CLI profile to avoid accidental credential and region crossover from cloud profiles. Local profile scripts with explicit endpoint and region values make commands repeatable and safer for daily development. This also prevents confusion when environment variables override your expected settings.
Common Pitfalls
A common pitfall is forgetting --endpoint-url on one command. You create tables locally, then list in cloud account, or the reverse.
Another issue is running multiple local instances on different ports and connecting to the wrong one from scripts.
Developers also assume localhost works from all containers. In containerized apps, use service hostnames on shared networks.
A final problem is no persistent volume mapping, so tables disappear on restart and listing appears empty unexpectedly.
Summary
- Ensure Docker container runs with expected port mapping and optional persistent volume.
- Always pass local DynamoDB endpoint in CLI commands.
- Verify container logs and health when listing fails.
- Use service hostnames for container-to-container communication.
- Keep runtime mode consistent between sessions to avoid data confusion.
Related reading
- econnrefused 127.0.0.15672 Rabbit-mq with docker compose
- ECONNREFUSED for Postgres on nodeJS with dockers
- ECS/ECR is common practice to have one repository per image and associated versions?
- ElasticSearch in Windows docker image vm max map count
- Dynamo db query using contains operator
- Dynamodb2 Table.get_item throws ValidationException The number of conditions on the keys is invalid
- DynamoDb - How to do a batch update?
- Dynamodb - Is it bad practice to create lots of partitions with little data?

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.