Debugging a Neo4j server extension in a Docker container

October 19, 2016
neo4j docker

This tutorial assumes you know how to run Neo4j inside a Docker container and how to configure a Neo4j server extension.

Configuring Docker

The only difference in our docker-compose.yml file is the addition of port 5005 to our exposed ports list.

version: "2"

services:
    neo:
        image: neo4j:3.0
        mem_limit: 4096m
        restart: on_failure
        ports:
            - "7474"
            - "7687"
            - "5005"
        volumes:
            - ./data:/data
            - ./conf:/conf
            - ./plugins:/plugins

Configuring Neo4j

Add the following line to neo4j-wrapper.conf in conf directory.

dbms.jvm.additional=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005

Attaching a debugger

Relaunching the container with docker-compose up will spawn Neo4j server as well as open port 5005 for a remote debugging session. This port can be accessed on localhost:5005 on the host machine. While this subject is beyond the scope of the tutorial, there will be a follow-up tutorial on how to configure IntelliJ IDEA.