Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Can I control the address the sandbox is binding to when starting up?Forum ↗

Can I control the address the sandbox is binding to when starting up?

App Development4 posts563 views5 likesLast activity May 2020
GE
georgOP
May 2020

I’m running the sandbox inside a Docker container and it seems to bind to localhost, which doesn’t allow me to access the process from the outside. Is there a way to control that? I skimmed the documentation but could find anything.

CO
cocreature
May 2020

By default sandbox listens on localhost. You can change that using daml sandbox --address 0.0.0.0 (-a 0.0.0.0 works as a short form) to listen on all interfaces or specify a specific external IP that you want to listen on.

GE
georg
May 2020

Thanks, that did the trick. My docker run command looks as follows:

docker run -p 6865:6865 digitalasset/daml-sdk:1.0.1 /bin/bash -c 'daml sandbox --address=0.0.0.0 --ledgerid=test'

Note that I had to use -p 6865:6865, if I just use -p 6865 it doesn’t work. I’m not sure the difference, but I’m no docker expert.

CO
cocreature
May 2020

If you omit the host port, docker expose the given container port on a random port on the host. You can use docker port <containername> to see the mapping.

← Back to Discussions