# How to start dgraph stack locally using compose

**URL:** <https://discuss.dgraph.io/t/how-to-start-dgraph-stack-locally-using-compose/15820>\
**Category:** Dgraph\
**Tags:** kind:question\
**Created:** [October 17, 2021, 2:25pm UTC](https://discuss.dgraph.io/t/how-to-start-dgraph-stack-locally-using-compose/15820 "2021-10-17T14:25:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nico\_Braun](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/nico_braun/32/7207_2.png) [@Nico\_Braun](https://discuss.dgraph.io/u/Nico_Braun)\
**Post date:** [October 17, 2021, 2:25pm UTC](https://discuss.dgraph.io/t/how-to-start-dgraph-stack-locally-using-compose/15820/1 "2021-10-17T14:25:17Z")

</div>

Hi, I am trying to start dgraph with docker compose, as shown in the provided [compose file](https://raw.githubusercontent.com/dgraph-io/dgraph/master/contrib/config/docker/docker-compose.yml) from the docs, but it’s not working properly. Somehow the services seem to use localhost instead of the configured hostname.

```auto
zero_1 | E1017 14:12:02.495738 1 pool.go:311] CONN: Unable to connect with localhost:7080 : rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:7080: connect: connection refused"

```

```auto
alpha_1 | I1017 14:12:02.701377 1 pool.go:164] CONN: Connecting to localhost:5080
alpha_1 | E1017 14:12:04.201835 1 groups.go:1181] Error during SubscribeForUpdates for prefix "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x15dgraph.graphql.schema\x00": Unable to find any servers for group: 1. closer err: <nil>

```

```auto
version: "3.9"

services:
  zero:
    image: dgraph/dgraph
    volumes:
      - dgraph:/dgraph
    ports:
      - 5080:5080
      - 6080:6080
    command: dgraph zero --my=zero:5080 --telemetry "sentry=false;"

  alpha:
    image: dgraph/dgraph
    volumes:
      - dgraph:/dgraph
    ports:
      - 8080:8080
      - 9080:9080
    command: dgraph alpha --my=alpha:7080 --zero=zero:5080 --telemetry "sentry=false;"
    environment:
      DGRAPH_ALPHA_GRAPHQL_LAMBDA_URL: "http://lambda:8686/graphql-worker"

  lambda:
    image: dgraph/dgraph-lambda
    ports:
      - 8686:8686
    environment:
      DGRAPH_URL: http://alpha:8080
    # volumes:
    # - ./gql/script.js:/app/script/script.js:ro

  ratel:
    image: dgraph/ratel
    ports:
      - 8000:8000

volumes:
  dgraph: {}

```

On a sidenote, I don’t know how to configure ratel as it has [no documentation](https://hub.docker.com/r/dgraph/ratel) at all on dockerhub.

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [October 17, 2021, 5:16pm UTC](https://discuss.dgraph.io/t/how-to-start-dgraph-stack-locally-using-compose/15820/2 "2021-10-17T17:16:54Z")

</div>

> [@Nico\_Braun](#):
>
> `CONN: Connecting to localhost:5080`

Do a deep cleanup in your Docker env. Also, check any bound paths and clean them too. Check for any Dgraph volume and delete them.

Ratel won’t access the Alpha via [http://alpha:8080](http://alpha:8080) cuz this is an internal naming in Docker’s internal network. As Ratel runs in your browser, you will have to use localhost or the IP of the VM if Docker is running in a VM.

Cheers.

---

<div class="post-metadata">

**Author:** ![Nico\_Braun](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/nico_braun/32/7207_2.png) [@Nico\_Braun](https://discuss.dgraph.io/u/Nico_Braun)\
**Post date:** [October 17, 2021, 6:51pm UTC](https://discuss.dgraph.io/t/how-to-start-dgraph-stack-locally-using-compose/15820/3 "2021-10-17T18:51:54Z")

</div>

I guess it was the volume from the previous try where there was the standalone container in use. Removing the volume has resolved the issue.
