DynamoDB and SQS containers with Docker Compose
June 13, 2026Docker Compose facilitates spinning up local AWS-compatible services without an AWS account. This post covers DynamoDB Local for key-value storage and ElasticMQ for an SQS-compatible message queue. A common pattern is to persist state in DynamoDB and notify workers through SQS.
Prerequisites
- Docker Compose installed
Configuration
The following configuration spins up DynamoDB Local, DynamoDB Admin, ElasticMQ, and the ElasticMQ UI.
Connection details:
- DynamoDB endpoint:
http://localhost:8000 - SQS endpoint:
http://localhost:9324 - DynamoDB Admin:
http://localhost:8001 - ElasticMQ UI:
http://localhost:3000 - Region:
us-east-1 - Credentials: any dummy values (for example
local/local)
# docker-compose.ymlservices:dynamodb:image: amazon/dynamodb-local:latestuser: rootcommand: '-jar DynamoDBLocal.jar -sharedDb -dbPath /home/dynamodblocal/data'ports:- '8000:8000'volumes:- dynamodb_data:/home/dynamodblocal/datadynamodb-admin:image: aaronshaf/dynamodb-admin:latestports:- '8001:8001'environment:DYNAMO_ENDPOINT: http://dynamodb:8000AWS_REGION: us-east-1AWS_ACCESS_KEY_ID: localAWS_SECRET_ACCESS_KEY: localdepends_on:- dynamodbelasticmq:image: softwaremill/elasticmq-native:latestports:- '9324:9324'volumes:- ./elasticmq.conf:/opt/elasticmq.conf- elasticmq_data:/dataelasticmq-ui:image: softwaremill/elasticmq-ui:latestports:- '3000:3000'environment:SQS_ENDPOINT: http://elasticmq:9324depends_on:- elasticmqvolumes:dynamodb_data:elasticmq_data:
ElasticMQ loads queue definitions from an elasticmq.conf file included in the demo.
Run the following command to spin up the containers.
docker compose up -d
Disclaimer
ElasticMQ provides an SQS-compatible API, but it is not AWS SQS. DynamoDB Local also differs from managed DynamoDB (for example capacity modes, streams, TTL, and global tables). Use these containers for local development and integration tests, not as production substitutes.
Demo
Docker Compose files and scripts for this post live in the dynamodb-sqs-docker-compose folder. Get access via code demos.