Published 2023/01/04 - Updated 2023/01/07 - Written by Nathaniel Walser

How to deploy EventStoreDB with Docker Compose

EventStoreDB is a database that is designed to store data as a series of events. It supports features like persistent subscriptions, catch up subscriptions and projections, just to name a few. It can be used to implement patterns like event sourcing.

This setup is tailored for development purposes only. For production it needs to be extended quite a bit.

Install EventStoreDB

Create a docker-compose.yml file in an empty directory. Copy the following content into the newly created file.

version: "3.4"

services:
  eventstoredb:
    image: eventstore/eventstore:latest
    environment:
      - EVENTSTORE_INSECURE=true # let eventstore run without ceritficate
      - EVENTSTORE_EXT_TCP_PORT=1113 # set internal tcp port
      - EVENTSTORE_HTTP_PORT=2113 # set internal admin ui port
      - EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=true
    ports:
      - "1113:1113" # map internal tcp port
      - "2113:2113" # map internal admin ui port
    volumes:
      - type: volume
        source: eventstore-data
        target: /var/lib/eventstore
      - type: volume
        source: eventstore-logs
        target: /var/log/eventstore

volumes:
  eventstore-data:
  eventstore-logs:

Run docker-compose up in your terminal inside this folder to download and start the EventStoreDB container.

# CLI
docker-compose up

Get started with the gRPC Client

Install the gRPC client SDK inside of your project.

# CLI
dotnet add package EventStore.Client.Grpc.Streams

# Nuget PM
Install-Package EventStore.Client.Grpc.Streams

After the installation you can create an EventStoreDB client like this:

var settings = EventStoreClientSettings
    .Create("esdb+discover://host.docker.internal:2113");
var client = new EventStoreClient(settings);

For more examples, like how to setup catch up subscriptions or append events to streams check out the official EventStoreDB docs.

Get started with the Admin UI

After installation your EventStoreDB admin ui is available under port 2113. You can access it without username and password under http://host.docker.internal:2113/.

More Templates