# Serverless.yml not creating dynamodb table locally

**URL:** <https://forum.serverless.com/t/serverless-yml-not-creating-dynamodb-table-locally/7453>\
**Category:** Serverless Framework\
**Tags:** dynamodb\
**Created:** [February 20, 2019, 7:04pm UTC](https://forum.serverless.com/t/serverless-yml-not-creating-dynamodb-table-locally/7453 "2019-02-20T19:04:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![inst1nct23](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/inst1nct23/32/3063_2.png) [@inst1nct23](https://forum.serverless.com/u/inst1nct23)\
**Post date:** [February 20, 2019, 7:04pm UTC](https://forum.serverless.com/t/serverless-yml-not-creating-dynamodb-table-locally/7453/1 "2019-02-20T19:04:13Z")

</div>

I have a docker setup that runs serverless and dynamodb both in docker. In my serverless.yml I defined instructions for creating a table, yet when I run `docker compose up` it does not create the table (I’ve checked by running a query to list tables.

```auto
...
provider:
  name: aws
  runtime: nodejs8.10
  stage: dev
  region: eu-west-1

plugins:
  - serverless-dynamodb-local
  - serverless-offline

custom:
  dynamodb:
    inMemory: true
    port: 8000
    migrate: true # create tables on start
    onStart: true
  serverless-offline:
    babelOptions:
      presets: ["es2015"]

resources:
  Resources:
    UserTable:
      Type: "AWS::DynamoDB::Table"
      Properties:
        TableName: UserTable
        AttributeDefinitions:
          - AttributeName: userId
            AttributeType: S
          - AttributeName: fullname
            AttributeType: S
        KeySchema:
          - AttributeName: userId
            KeyType: HASH
        ProvisionedThroughput:
          ReadCapacityUnits: 1
          WriteCapacityUnits: 1

```

```auto
docker-compose.yml
version: "3"

services:
  serverless:
    build: .
    restart: always
    privileged: true
    working_dir: /home/node-app
    environment:
      - NODE_ENV=development
      - DYNAMO_ENDPOINT=http://dynamodb:8000
      - AWS_ACCESS_KEY_ID='dev-key-id'
      - AWS_SECRET_ACCESS_KEY='dev-key'
      - AWS_REGION='eu-west-1'
    links:
      - "dynamodb:dynamodb"
    command: npm run start
  ....
  dynamodb:
    image: amazon/dynamodb-local
    ports:
      - "8000:8000"
    environment:
      - AWS_ACCESS_KEY_ID='dev-key-id'
      - AWS_SECRET_ACCESS_KEY='dev-key'

```

`npm run start` simply runs `sls offline` . Once I run the docker compose, everything starts up fine but the `UserTable` is not created.

![](https://yyz2.discourse-cdn.com/flex036/uploads/serverless/original/2X/b/bbffcf89001a7915f2244c0fde57284ce564e079.png)

---

<div class="post-metadata">

**Author:** ![jibran](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/jibran/32/7355_2.png) [@jibran](https://forum.serverless.com/u/jibran)\
**Post date:** [March 8, 2023, 6:38am UTC](https://forum.serverless.com/t/serverless-yml-not-creating-dynamodb-table-locally/7453/2 "2023-03-08T06:38:35Z")

</div>

I’m sorry, I do not know the answer to your query, but I want to thank you for making me understand the use of “migrate”, I was searching for hours, on why the table was not being created for me.

turns out I missed `migrate: true`
