Can't reach Algorand Docker container from another container


I have a couple of docker containers running of which one is a server- and one an Algorand container. From the server container I can ping the Algorand container. However, when trying to list wallets via the api I get the error returned:

dial tcp connect: connection refused

	// create KMD client
  kmdClient, err := kmd.MakeClient(KMDADDRESS, KMDTOKEN)
	// Create an algod client
	algodClient, err := algod.MakeClient(ALGODADDRESS, ALGODTOKEN)

	// Get the list of wallets
	listResponse, err := kmdClient.ListWallets()
	if err != nil {
		return "", err

Both kmdClient and algodClient are created.

Furthermore, all containers are connected to the dev_projects_default network. When running

$ docker network inspect dev_projects_default

yields the ip addresses of all the containers.

Complete error:

Get "": dial tcp connect: connection refused
listResponse is:  {{{} false } []}

Any help appreciated

1 Like

Have you changed $ALGORAND_DATA/config.json (for algod) and $ALGORAND_DATA/kmd/kmd-v0.5/kmd_config.json (for kmd) to allow connections from any IP? By default, it only allows connections from localhost.

Concretely, have you set EndpointAddress to for algod and address to for kmd?


1 Like


Hi Fabrice, that was it. Thanks a million man!