DynamoDB Local in Docker: Keep Your Data, Fix "Could Not Connect" From Other Containers, Volume Permissions and a Working docker-compose.yml

Logeshwaran
—

DynamoDB Local runs in Docker with one command, docker run -p 8000:8000 amazon/dynamodb-local, and then answers at http://localhost:8000 with any fake credentials. The surprise comes the first time you restart it: every table is gone. The official image starts with -inMemory by default, so nothing is ever written to disk. Keeping your data takes three changes: -sharedDb, -dbPath ./data and a volume. The other classic failures are just as predictable. From another container, localhost is that container itself, so the endpoint must be the service name and the container port, such as http://dynamodb-local:8000, never the host port. A host folder mounted as the data directory leaves requests hanging while the log says unable to open database file, because the image runs as uid 1000. Without -sharedDb, each access key and Region gets its own database file, so tables seem to vanish when your code and your CLI use different Regions. And an access key with a dash in it is rejected outright.

Ethan was building a booking app for Jake's repair shop and wanted to test it on his laptop before touching real AWS. DynamoDB Local in Docker looked perfect: free, offline, the same API. On Monday he created the Bookings table and loaded fifty test bookings. On Tuesday he rebooted, started the container again, and the table was gone. On Wednesday he put the app in its own container and it could not connect at all. On Thursday he mounted a folder to keep the data and every request froze. Jake watched the week go by and finally asked, "Is this database broken, or are you?" Neither, it turned out. Every one of those problems has a one-line cause, and this page covers all of them: the quick start, keeping data, Docker Compose, connecting from other containers, folder permissions, credentials and Regions, healthchecks, using it from Python and Node.js, and where it differs from the real DynamoDB.

⚡ Quick Answer

• Tables vanish on restart? → The image defaults to -inMemory. Run it with -jar DynamoDBLocal.jar -sharedDb -dbPath ./data and a named volume. Keep your data.

• Can't connect from another container? → Use http://dynamodb-local:8000 (service name, container port), never localhost. Networking.

• Requests hang with a mounted folder? → The container user is uid 1000; use a named volume or give the folder to uid 1000. Permissions.

• Tables missing in your app but not the CLI? → Without -sharedDb, each key and Region has its own database. Why.

• A working docker-compose.yml → With a volume and a healthcheck. Copy it.

DynamoDB Local is free, runs offline and never touches your AWS account or bill.

New to DynamoDB itself? Our plain-English guide to what Amazon DynamoDB is explains tables, items and keys first. If containers are new to you too, our guide to containers vs virtual machines is a gentle start.

DynamoDB Local in Docker: the 60-second start

DynamoDB Local is the downloadable version of DynamoDB that AWS publishes for development and testing. It speaks the same API as the real service, so your code, the AWS CLI and the SDKs work against it by changing one thing: the endpoint URL. The official container image is amazon/dynamodb-local; at the time of writing it runs DynamoDB Local 3.3.1 on Java 17, on an Amazon Linux 2023 base.

docker run -d --name dynamodb-local -p 8000:8000 amazon/dynamodb-local

Then point the AWS CLI at it with --endpoint-url:

aws dynamodb list-tables --endpoint-url http://localhost:8000 --region us-east-1

Three details make that first command work for you:

  • Any credentials, but you must have some. The SDKs and CLI refuse to send a request without an access key and secret key, so set fake ones. They do not need to be real AWS keys, and nothing reaches AWS. One rule: the access key ID may contain only letters and numbers.
  • Any Region, but set one. A Region is required by the tools; DynamoDB Local uses it only to name its database file, as explained below.
  • Port 8000 by default. If something else uses 8000 on your machine, map another host port: -p 8001:8000, then use http://localhost:8001.

If the AWS CLI is not installed or configured yet, our guide to "Unable to locate credentials" covers it. For fake keys without touching your real profile, prefix commands with AWS_ACCESS_KEY_ID=local AWS_SECRET_ACCESS_KEY=local, or create a separate profile just for local work.

Why your tables vanish when the container restarts

This is the first surprise for almost everyone, and it is by design. Ask the image what it runs by default:

docker image inspect amazon/dynamodb-local --format '{{json .Config.Entrypoint}} {{json .Config.Cmd}}'

The answer is ["java"] ["-jar","DynamoDBLocal.jar","-inMemory"]. With -inMemory, DynamoDB Local writes no database file at all; everything lives in memory and disappears when the container stops. In a test, you can watch it happen: a Bookings table created, the container restarted, and list-tables returning an empty list.

That default is useful for automated tests that should start clean every time. For development, where you want your data tomorrow, replace the command and give it somewhere to write:

docker volume create dynamodb-data

# one time: give the new volume to the image's user (uid 1000)
docker run --rm --user root --entrypoint chown \
  -v dynamodb-data:/home/dynamodblocal/data \
  amazon/dynamodb-local 1000:1000 /home/dynamodblocal/data

docker run -d --name dynamodb-local -p 8000:8000 \
  -v dynamodb-data:/home/dynamodblocal/data \
  amazon/dynamodb-local -jar DynamoDBLocal.jar -sharedDb -dbPath ./data

Each part has a job:

  • -jar DynamoDBLocal.jar has to be repeated, because your command replaces the image's whole default command. The image's entrypoint is java, so without -jar, Java itself receives -sharedDb and stops with Unrecognized option: -sharedDb and Error: Could not create the Java Virtual Machine.
  • -dbPath ./data writes the database file into /home/dynamodblocal/data, because the image's working directory is /home/dynamodblocal. -dbPath and -inMemory cannot be used together.
  • -sharedDb uses one database file for everyone, shared-local-instance.db, which avoids the vanishing-table problem in the next section.
  • -v dynamodb-data:/home/dynamodblocal/data puts that folder on a named volume, which survives restarts, rebuilds and even docker rm.
  • The one-time chown matters because the image runs as user dynamodblocal, uid 1000, and the data folder does not exist in the image. Docker creates a brand-new volume for a missing folder owned by root, which uid 1000 cannot write to. Podman hands new volumes to the container's user on its own, so there the step is harmless but not needed.

Restart that container and the table is still there. Delete the volume, or the shared-local-instance.db file inside it, and the data is gone, which is also the cleanest way to reset.

Jake: "So by default it's a whiteboard, not a notebook. Wipe the board and the bookings are gone."

Ethan: "Right. And -dbPath with a volume turns the whiteboard into a notebook kept in a drawer. The drawer survives even if I throw away the desk."

Tables "missing" in your app: one database per key and Region

Here is the second surprise. If you run DynamoDB Local with -dbPath but without -sharedDb, it does not keep one database. It keeps one database file per combination of access key ID and Region, named like fakeKey_us-east-1.db. A table created by your app with Region eu-west-1 lives in a different file from the one your AWS CLI reads with us-east-1, and each tool sees an empty list for the other.

Here is what that looks like in practice. One table created with key fakeKey in us-east-1; then:

Who asksAccess keyRegionSees the table?
The same codefakeKeyus-east-1Yes
The CLI with another RegionfakeKeyeu-west-1No, empty list
A teammate's app with another keyotherKeyus-east-1No, empty list
Anyone, when started with -sharedDbanyanyYes

The data folder shows why: three files, fakeKey_eu-west-1.db, fakeKey_us-east-1.db and otherKey_us-east-1.db, one for each combination that connected. Unless you deliberately want separate databases per Region, start with -sharedDb and the question never comes up. With -inMemory there are no files, and every client shares the one in-memory database.

A docker-compose.yml that keeps data and waits until ready

For anything beyond a quick test, Docker Compose is the easiest way to run DynamoDB Local next to your app. This file keeps the data in a named volume, publishes port 8000 for your own tools, and makes the app wait until DynamoDB Local is actually answering:

services:
  dynamodb-init:
    image: amazon/dynamodb-local
    user: root
    entrypoint: ["chown", "-R", "1000:1000", "/home/dynamodblocal/data"]
    volumes:
      - dynamodb-data:/home/dynamodblocal/data

  dynamodb-local:
    image: amazon/dynamodb-local
    depends_on:
      dynamodb-init:
        condition: service_completed_successfully
    command: ["-jar", "DynamoDBLocal.jar", "-sharedDb", "-dbPath", "./data"]
    ports:
      - "8000:8000"
    volumes:
      - dynamodb-data:/home/dynamodblocal/data
    healthcheck:
      test: ["CMD-SHELL", "[ \"$$(curl -s -o /dev/null -w '%{http_code}' http://localhost:8000)\" = \"400\" ]"]
      interval: 5s
      timeout: 3s
      retries: 20

  app:
    build: .
    depends_on:
      dynamodb-local:
        condition: service_healthy
    environment:
      DYNAMODB_ENDPOINT: http://dynamodb-local:8000
      AWS_ACCESS_KEY_ID: local
      AWS_SECRET_ACCESS_KEY: local
      AWS_REGION: us-east-1

volumes:
  dynamodb-data:

Start everything with docker compose up -d. Five details matter:

  • The short dynamodb-init service runs once as root, gives the volume to uid 1000 and exits; service_completed_successfully makes DynamoDB Local wait for it. Only that tiny step runs as root, not the database.
  • The command is a list. Compose accepts the command as one string or as a list, but a list cannot hold the whole command as a single element. Passing "-jar DynamoDBLocal.jar -sharedDb" as one argument makes Java complain Unrecognized option: -jar DynamoDBLocal.jar -sharedDb. Use one list item per word, as above, or a plain string.
  • The healthcheck expects 400. A plain GET / to DynamoDB Local answers with status 400 once it is running, which makes it a reliable "ready" signal. The image includes curl, and the doubled $$ stops Compose from treating $(...) as one of its own variables.
  • condition: service_healthy makes the app wait. A plain depends_on only waits for the container to start, not for Java to finish starting, so the app's first request can fail while the database is still starting up.
  • The app's endpoint is the service name and container port, http://dynamodb-local:8000. The next section explains why.

"Could not connect to the endpoint URL" from another container

This is the problem behind the most-viewed DynamoDB Local questions online. Your code works on your laptop, then fails the moment it runs in its own container, with an error such as Could not connect to the endpoint URL: "http://localhost:8000/" in Python, or UnknownEndpoint: Inaccessible host: localhost in older Node.js code.

The reason is simple once you see it: inside a container, localhost means that container itself. Your app's container has nothing listening on port 8000, so the connection fails. Here is what each endpoint does from a second container on the same Docker network, run against a DynamoDB Local container named dynamodb-local published as -p 8114:8000:

Endpoint used inside the app containerResultWhy
http://localhost:8000Could not connectlocalhost is the app's own container
http://dynamodb-local:8114Could not connect8114 is the port on your computer, not inside the network
http://dynamodb-local:8000WorksService name plus the container's own port

So the rule for containers talking to containers: use the service name (or container name) and the container port, 8000. The ports: mapping only matters for tools running on your computer, outside Docker. Containers on the same Compose project share a network automatically, so the name resolves without anything extra.

Two other setups need different addresses:

  • DynamoDB Local on your computer, app in a container (common with AWS SAM, which runs functions in containers): on Docker Desktop, use http://host.docker.internal:8000, which points from inside a container back to your computer.
  • Containers started separately with docker run: put both on the same user-defined network, with docker network create dev and --network dev on each, then use the container name, as above.

Jake: "So inside the box, 'localhost' means the box you're standing in, not the building."

Ethan: "Exactly. To reach the next box, you call it by its name. And you knock on its own door, 8000, not the door number painted on the outside of the building."

Requests hang with a mounted folder: "unable to open database file"

The fourth surprise hits people who mount a folder from their computer instead of a named volume, as in -v ./docker/dynamodb:/home/dynamodblocal/data. DynamoDB Local starts normally, then every request hangs until the client times out, and the container log fills with:

WARNING: [sqlite] cannot open DB[1]: com.almworks.sqlite4java.SQLiteException: ... unable to open database file

The image runs as a non-root user, dynamodblocal, with uid 1000. When the folder you mount belongs to another user, or to root because Docker created it for you, that user cannot create the database file inside it. Inside the container, a quick test shows it plainly: touch data/x answers Permission denied.

There are four fixes, from best to last resort:

  1. Use a named volume instead of a folder, with the one-time ownership step shown earlier, or the dynamodb-init service in the compose file above. It works the same on every machine.
  2. Give the folder to uid 1000 on Linux with Docker: sudo chown -R 1000:1000 ./docker/dynamodb, then start the container again.
  3. On Podman, add :U to the mount, as in -v ./docker/dynamodb:/home/dynamodblocal/data:U, and Podman changes the folder's owner to the container user for you.
  4. Run the container as root with user: root in Compose or --user root. It works, and it is the most-copied answer online, but it runs a database as root to solve a folder ownership problem; prefer the fixes above.

One more trap if your project lives on an external drive formatted as NTFS or exFAT: SQLite, which DynamoDB Local uses under the hood, does not work reliably on those file systems through a container mount, and requests can fail even with the permissions fixed. Keep the data on a named volume or a normal Linux folder.

Credentials, Regions and UnrecognizedClientException

DynamoDB Local does not check your credentials against AWS, but it does check their shape. An access key ID may contain only letters and numbers. A key such as my-key or local_dev is rejected with:

An error occurred (UnrecognizedClientException) when calling the ListTables operation: The Access Key ID or security token is invalid.

That is the same message the real DynamoDB gives for a bad key, which sends people hunting through their AWS account for a problem that is purely local. Use a plain value such as local or fakeKey. For the real-AWS version of this error, our guide to UnrecognizedClientException covers the causes.

Empty credentials fail too, before any request is sent: the SDKs and CLI need some value. In Compose, set them as environment variables on the app service, as in the file above. And remember the Region decides the database file unless you use -sharedDb.

Using DynamoDB Local from Python and Node.js

Your code needs one change to use DynamoDB Local: the endpoint. Keep it in a setting, so the same code talks to the real DynamoDB when the setting is empty.

Python (boto3)

import os

import boto3

endpoint = os.environ.get("DYNAMODB_ENDPOINT")  # e.g. http://localhost:8000, unset in production
dynamodb = boto3.client(
    "dynamodb",
    endpoint_url=endpoint,
    region_name=os.environ.get("AWS_REGION", "us-east-1"),
)

dynamodb.create_table(
    TableName="Bookings",
    AttributeDefinitions=[{"AttributeName": "id", "AttributeType": "S"}],
    KeySchema=[{"AttributeName": "id", "KeyType": "HASH"}],
    BillingMode="PAY_PER_REQUEST",
)
dynamodb.put_item(TableName="Bookings", Item={"id": {"S": "b-1001"}, "phone": {"S": "Pixel 8"}})
print(dynamodb.get_item(TableName="Bookings", Key={"id": {"S": "b-1001"}})["Item"])

On Kali and other recent Linux systems, install boto3 in a virtual environment; a system-wide pip install is refused, as our guide to the externally-managed-environment error explains.

Node.js (AWS SDK for JavaScript v3)

import { DynamoDBClient, ListTablesCommand } from "@aws-sdk/client-dynamodb";

const client = new DynamoDBClient({
  endpoint: process.env.DYNAMODB_ENDPOINT, // e.g. http://localhost:8000, unset in production
  region: process.env.AWS_REGION ?? "us-east-1",
});

const out = await client.send(new ListTablesCommand({}));
console.log(out.TableNames);

Credentials come from the usual places in both languages, such as the environment variables in the compose file. In code running inside a container, the endpoint is the service name, never localhost.

Create a table and load test data from the command line

An empty database is not much use for testing. These three commands create a table, load a few items from a file and check the result; they work the same against DynamoDB Local and, without --endpoint-url, against a real table. First the table:

aws dynamodb create-table --endpoint-url http://localhost:8000 \
  --table-name Bookings \
  --attribute-definitions AttributeName=id,AttributeType=S \
  --key-schema AttributeName=id,KeyType=HASH \
  --billing-mode PAY_PER_REQUEST --query 'TableDescription.TableStatus'

Locally, the answer is "ACTIVE" straight away. Then save your test items in a file called bookings.json, in the format batch-write-item expects, up to 25 items per call:

{
  "Bookings": [
    {"PutRequest": {"Item": {"id": {"S": "b-1001"}, "phone": {"S": "Pixel 8"}, "repair": {"S": "screen"}}}},
    {"PutRequest": {"Item": {"id": {"S": "b-1002"}, "phone": {"S": "iPhone 15"}, "repair": {"S": "battery"}}}},
    {"PutRequest": {"Item": {"id": {"S": "b-1003"}, "phone": {"S": "Galaxy S24"}, "repair": {"S": "charging port"}}}}
  ]
}

Load it and check:

aws dynamodb batch-write-item --endpoint-url http://localhost:8000 --request-items file://bookings.json
aws dynamodb scan --endpoint-url http://localhost:8000 --table-name Bookings --query 'Count'
aws dynamodb get-item --endpoint-url http://localhost:8000 --table-name Bookings \
  --key '{"id": {"S": "b-1002"}}' --query 'Item.phone.S' --output text

A successful load answers with an empty "UnprocessedItems": {}, the scan counts 3, and the last command prints iPhone 15. Keep the JSON file in your project, and resetting the database becomes "delete the volume, run three commands."

Running DynamoDB Local without Docker

If you would rather not use containers at all, DynamoDB Local is also a plain Java program. Download the archive from AWS, extract it, and start it from that folder with Java 17 or newer:

java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb

Without -dbPath, the database file is written to the current folder; add -inMemory for a throwaway session or -port 8001 if 8000 is taken. In Windows PowerShell, put quotes around the library option, as in java "-Djava.library.path=./DynamoDBLocal_lib" -jar DynamoDBLocal.jar, or PowerShell splits it. Press Ctrl+C to stop it. Everything else on this page, from credentials and Regions to -sharedDb, applies exactly the same; only the container-specific parts, networking and folder permissions, go away.

Where DynamoDB Local differs from the real DynamoDB

DynamoDB Local is built to behave like the real service for your code, but it is not the real service. Knowing the differences saves you from trusting a test that cannot fail, or chasing a failure that cannot happen in production:

BehaviorReal DynamoDBDynamoDB Local
Table namesCase-sensitive: Authors and authors are two tablesCase-insensitive: creating authors after Authors fails with InternalFailure, "The request processing has failed because of an unknown error"
Creating or deleting a tableTakes time; status passes through CREATING or DELETINGImmediate; status is always ACTIVE (indexes still pass through CREATING and DELETING)
Provisioned throughputEnforced, with throttlingIgnored, and you can call UpdateTable as often as you like
Parallel scansSupported with Segment and TotalSegmentsIgnored; scans run sequentially
Read consistencyEventually consistent unless you ask for strongEventually consistent, but most reads look strongly consistent because it is fast
Transaction conflictsTransactionConflictException can happenNever thrown
1 MB result limit on index queriesCounts only projected attributesCounts the entire item
Tagging, point-in-time recoverySupportedNot supported
Credentials and IAMChecked against IAM policiesAny letters-and-numbers key works; no permissions are checked

The table-name row is the one that bites in production: code that creates bookings locally and reads Bookings works on your laptop and fails in AWS. The -delayTransientStatuses option makes index creation and deletion take time locally, which helps you catch code that forgets to wait. Some validation errors are also worded differently; our guide to "One or more parameter values were invalid" shows cases where the local message differs from the one AWS sends.

Before you point the same code at a real table, run through this list:

  1. Unset the endpoint. Make sure DYNAMODB_ENDPOINT, or whatever setting you use, is empty in production, so the SDK talks to AWS.
  2. Use real credentials and the right Region. The fake keys stop working, and the Region now decides where the table really lives.
  3. Check every table name's spelling and case, because AWS is case-sensitive and DynamoDB Local was not.
  4. Wait for tables to become ACTIVE after creating them; locally that was instant.
  5. Test with the real role's permissions, since DynamoDB Local never checked IAM.
  6. Run your tests once against a development table in AWS, including a parallel scan or a transaction if your code uses them.

Use DynamoDB Local for fast feedback while you write code, and keep at least one test run against a real table, in a development AWS account, before you ship.

Troubleshooting by symptom

All my tables disappeared after a restart

The container ran with the default -inMemory. Start it with -jar DynamoDBLocal.jar -sharedDb -dbPath ./data and a named volume on /home/dynamodblocal/data.

"Unrecognized option: -sharedDb" and the container exits

Your command left out -jar DynamoDBLocal.jar. The image's entrypoint is java, so your command must start with -jar DynamoDBLocal.jar.

"Unrecognized option: -jar DynamoDBLocal.jar -sharedDb"

The whole command was passed as one list item. Split it into one item per word, or write it as a single string.

"Could not connect to the endpoint URL: http://localhost:8000/" from my app container

Use the service name and container port, http://dynamodb-local:8000, or host.docker.internal if DynamoDB Local runs on your computer rather than in a container.

"Connection refused" on the host port from inside Docker

Inside the Docker network, use the container port, 8000, even if you published it on another host port such as 8001.

Requests hang and the log says "unable to open database file"

The mounted folder is not writable by uid 1000. Use a named volume, chown the folder to 1000:1000, or :U on Podman.

My app sees no tables, but the CLI does

Different access keys or Regions without -sharedDb. Restart with -sharedDb, or make both use the same key and Region.

"The Access Key ID or security token is invalid" locally

The fake access key contains a character other than letters and numbers. Use something like local.

The app's first request fails, then later ones work

The app started before DynamoDB Local was ready. Add the healthcheck and condition: service_healthy from the compose file.

InternalFailure when creating a table that differs only in case

DynamoDB Local treats table names as case-insensitive, so authors collides with an existing Authors and the create fails with an unhelpful InternalFailure. The real DynamoDB would accept both. Pick one spelling and use it everywhere.

"Port is already allocated" or the container exits on start

Something else on your computer uses port 8000. Map another host port, such as -p 8001:8000, and use that port from the host only.

DynamoDB Local in Docker: frequently asked questions

How do I run DynamoDB Local in Docker?

Run docker run -d -p 8000:8000 amazon/dynamodb-local, then use --endpoint-url http://localhost:8000 with the AWS CLI or the endpoint setting in your SDK, with any fake credentials and a Region. Add -sharedDb, -dbPath ./data and a volume to keep data.

Why does DynamoDB Local lose my data when the container restarts?

The official image's default command includes -inMemory, so no database file is written. Override the command with -jar DynamoDBLocal.jar -sharedDb -dbPath ./data and mount a named volume on /home/dynamodblocal/data.

How do I persist DynamoDB Local data with docker-compose?

Set command to -jar DynamoDBLocal.jar -sharedDb -dbPath ./data, mount a named volume at /home/dynamodblocal/data, and give the volume to uid 1000 once with a small init service. The data then survives restarts and container removal.

How do I connect to DynamoDB Local from another Docker container?

Use the service or container name and the container port, for example http://dynamodb-local:8000, with both containers on the same network. localhost inside a container refers to that container, and published host ports do not apply inside the network.

What does -sharedDb do in DynamoDB Local?

It makes every client use one database file, shared-local-instance.db, whatever access key and Region they use. Without it, each key and Region pair gets its own file, so tables created by one client are invisible to another.

Do I need real AWS credentials for DynamoDB Local?

No. Any values work, but they must be present, and the access key ID may contain only letters and numbers. Nothing is sent to AWS, and DynamoDB Local never touches your account or bill.

What is the default port for DynamoDB Local?

Port 8000. In Docker, publish it with -p 8000:8000, or map another host port such as -p 8001:8000 if 8000 is busy. Containers on the same network still use 8000.

Why do I get "unable to open database file" with DynamoDB Local in Docker?

The container runs as uid 1000 and cannot write to the mounted folder. Use a named volume, change the folder's owner to 1000:1000, use :U on Podman, or as a last resort run the container as root.

How do I add a healthcheck for DynamoDB Local in docker-compose?

Check that curl -s -o /dev/null -w '%{http_code}' http://localhost:8000 returns 400, which DynamoDB Local answers once it is running, and use condition: service_healthy under depends_on so the app waits for it.

Why does DynamoDB Local say "Unrecognized option"?

Your command replaced the image's default and left out -jar DynamoDBLocal.jar, or passed the whole command as a single list item. The entrypoint is java, so the command must begin with -jar DynamoDBLocal.jar, one word per list item.

Can I use DynamoDB Local with AWS SAM?

Yes. SAM runs your functions in containers, so the function must reach DynamoDB Local through http://host.docker.internal:8000 on Docker Desktop, or through a shared Docker network and the container name.

Is DynamoDB Local the same as the real DynamoDB?

It uses the same API, but table names are case-insensitive, table operations are instant, throughput and IAM are not enforced, parallel scans and transaction conflicts are not simulated, and some error messages differ. Test against a real table before shipping.

How do I load test data into DynamoDB Local?

Create the table with aws dynamodb create-table and --endpoint-url http://localhost:8000, then load items from a JSON file with aws dynamodb batch-write-item --request-items file://data.json, up to 25 items per call. Check with a scan.

Can I run DynamoDB Local without Docker?

Yes. Download the archive from AWS and run java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb in the extracted folder. It needs Java 17 or newer and listens on port 8000.

How do I reset DynamoDB Local?

With -inMemory, restart the container. With -dbPath, stop the container and delete the volume, or the shared-local-instance.db file inside it, then start it again.

Which version of DynamoDB Local is in the Docker image?

The latest amazon/dynamodb-local image runs DynamoDB Local 3.3.1 on Java 17 at the time of writing. Run docker run --rm amazon/dynamodb-local -jar DynamoDBLocal.jar -version to check yours.

Can I view DynamoDB Local tables in the AWS console?

No. The console only shows real AWS resources. Use the AWS CLI with --endpoint-url, your SDK, or a local GUI tool that supports a custom endpoint.

What is the difference between DynamoDB Local and LocalStack?

DynamoDB Local is the free, official AWS emulator for DynamoDB only. LocalStack is a separate project that emulates many AWS services in one container. For DynamoDB alone, the official image is the simpler choice.

For readers preparing for an AWS certification

We have been covering AWS certifications alongside our fixes, so here is a short extra for readers studying for one. If you only came for the fix, you already have it; feel free to skip this part.

Exams that test this topic: Developer – Associate (DVA-C03 from December 1, 2026).

Here are the exam-style questions this topic tends to raise, with the reasoning you need to answer them:

1. What is DynamoDB local for?

Developing and testing applications offline, without cost; it is not for production.

2. How do you point the CLI or SDK at DynamoDB local?

Set the endpoint URL, for example --endpoint-url http://localhost:8000.

3. Why do tables created with one profile disappear with another?

DynamoDB local keeps separate databases per access key and Region unless started with -sharedDb.

4. Which features may behave differently locally?

Throughput limits, some capacity behaviors and certain service integrations are not enforced or available.

5. How do you keep data between container restarts?

Mount a volume and run with a database path instead of in-memory mode.

6. Which managed option gives a free development tier in the cloud instead?

The DynamoDB free tier: 25 GB of storage and 25 provisioned RCUs and WCUs.

Exam codes and dates change often. Our AWS certification changes page keeps track of what is current.

πŸ“š ALSO READ

Where to go next, from the DynamoDB errors you will meet while testing to the ones that only appear in AWS:

📌 Bookmark this; the four-line fix list covers every DynamoDB Local container problem.

By Friday, Ethan's laptop ran the booking app and DynamoDB Local side by side with one docker compose up. The fifty test bookings survived a reboot, the app found the database by name, and the data sat in a named volume that nobody had to fix permissions on. Jake asked for a demo and booked a fake screen repair for "Mr. Test." It was still there on Monday. "So the database was fine all week," Jake said. "It just needed to be told where to keep its notebook, and you needed to call it by its name." Ethan laughed. "That's most of computing, honestly."

📌 If you keep one line from this page

DynamoDB Local forgets by default; give it -sharedDb, -dbPath ./data and a volume, and call it by name, not localhost.

Container port 8000 inside Docker, letters-and-numbers fake keys, and a 400 healthcheck before your app starts.

Revision note. Written October 12, 2026, for everyone whose test data vanished overnight. As the old saying goes, the faintest ink is better than the best memory; give DynamoDB Local somewhere to write.

Related