# How to specify the location of data files when starting dgraph

**URL:** <https://discuss.dgraph.io/t/how-to-specify-the-location-of-data-files-when-starting-dgraph/18449>\
**Category:** Dgraph\
**Created:** [March 31, 2023, 3:40pm UTC](https://discuss.dgraph.io/t/how-to-specify-the-location-of-data-files-when-starting-dgraph/18449 "2023-03-31T15:40:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tellixu](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@tellixu](https://discuss.dgraph.io/u/tellixu)\
**Post date:** [March 31, 2023, 3:40pm UTC](https://discuss.dgraph.io/t/how-to-specify-the-location-of-data-files-when-starting-dgraph/18449/1 "2023-03-31T15:40:10Z")

</div>

## What I want to do

How to specify the location of data files when starting dgraph？

## What I did

I run the docker container dgraph/standalone, then the generated data files is in directory /dgraph.

I directly started “dgraph zero & dgraph alpha” in the host computer, the data files in the user’s home directory.

## Dgraph metadata

> **dgraph version**
>
> v22.0.2

---

<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:** [March 31, 2023, 3:50pm UTC](https://discuss.dgraph.io/t/how-to-specify-the-location-of-data-files-when-starting-dgraph/18449/2 "2023-03-31T15:50:06Z")

</div>

I don’t get it. Are you using Docker or the binary?

If docker you have to bind the path to your computer.

```auto
docker run -it -p 5080:5080 -p 6080:6080 -p 8080:8080 \
  -p 9080:9080 -v ~/dgraph:/dgraph --name dgraph \
  dgraph/standalone:latest

```

if you are using the binary you can use

```auto
dgraph zero -w /path/to/home/dgraph/zw & 
dgraph alpha -p /path/to/home/dgraph/p -w /path/to/home/dgraph/w

```

You should not us both at the same time. Stick to Docker cuz it is easier to handle.

Please, use our Tour [Welcome | Intro | Dgraph Tour](https://dgraph.io/tour/intro/1/)
