Search code examples
memgraphdb

Do I need to add IP address to Memgraph instance that runs in docker?


Do I need to provide the docker instance with a real IP address instead of a loopback address 127.0.0.1?


Solution

  • Usually, it isn't necessary, and you should be able to connect with the default parameters which are localhost and 7687.

    But if something is off, you can find the address of the Docker container with:

    docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id
    

    And you can find the container_name_or_id with docker ps. The connection command would look like this:

    memgraph = Memgraph(host="ip_address", port=7687)