Configuration Options

Location of config options

Configuration options for APOC can be set using:

Option Description

Environment variables

Set via either export key=val or --env settings when used for Docker.

conf/apoc.conf

Located in the same folder as neo4j.conf.

The order of the above table matches the config option precedence. For example, any environment variable setting will override options set in apoc.conf.

The apoc.conf file is not created automatically when installing the APOC plugin. Users have to create the file themselves.

Additionally, as of Neo4j v.5, APOC config settings are no longer supported in the neo4j.conf file. Users should move all apoc.* settings to the apoc.conf file.

It is also possible to set the config settings using environment variables.

Reference of config options

Table 1. apoc.export.file.enabled

Description

Enables writing local files to disk.

Valid values

BOOLEAN

Default value

false

Table 2. apoc.import.file.enabled

Description

Enables reading local files from disk.

Valid values

BOOLEAN

Default value

false

Table 3. apoc.import.file.use_neo4j_config

Description

If enabled, this setting controls whether file system access is allowed and possibly constrained to a specific directory by reading the two configuration parameters dbms.security.allow_csv_import_from_file_urls and server.directories.import respectively.

Valid values

BOOLEAN

Default value

true

Table 4. apoc.http.timeout.connect

Description

Sets a specified timeout value, in milliseconds, to be used when communicating with a URI. If the timeout expires before the connection can be established, then an exception is raised. A timeout of zero is interpreted as an infinite timeout.

Valid values

INTEGER

Default value

10000

Table 5. apoc.http.timeout.read

Description

Sets a specified timeout value, in milliseconds, to be used when communicating with a URI. If the timeout expires before the data is available to be read, then an exception is raised. A timeout of zero is interpreted as an infinite timeout.

Valid values

INTEGER

Default value

60000

Table 6. apoc.jobs.scheduled.num_threads

Description

The apoc.periodic procedures rely on a scheduled executor that has a pool of threads with a default fixed size. The pool size can be configured using this configuration property.

Valid values

INTEGER

Default value

number of CPU cores / 4

Table 7. apoc.jobs.pool.num_threads

Description

Number of threads in the default APOC thread pool used for background executions.

Valid values

INTEGER

Default value

number of CPU cores * 2

Table 8. apoc.jobs.queue.size

Description

Size of the ThreadPoolExecutor working queue.

Valid values

INTEGER

Default value

apoc.jobs.pool.num_threads * 5

Table 9. apoc.spatial.geocode.provider

Description

Configuration for geocoding providers. Keys and values are provider specific, see Configuring Geocode Provider.

Valid values

STRING: "osm", "google", "opencage"

Default value

osm

Table 10. apoc.trigger.enabled

Description

Enables the procedures in the apoc.trigger package.

Valid values

BOOLEAN

Default value

false

Table 11. apoc.trigger.refresh

Description

Triggers refresh rate, in milliseconds. The refresh rate refers to how long the database will wait before checking whether any new triggers have been installed, dropped, or stopped.

Valid values

INTEGER

Default value

60000

Table 12. apoc.max.decompression.ratio

Description

Limits the relative size a decompressed file can reach with respect to the compressed file in the loading procedures. If negative, no limit to the decompressed size is imposed.

Valid values

Integers different from 0

Default value

200

Command Expansion

This feature was introduced in APOC 5.11.

Command expansion provides an additional capability to configure APOC by allowing scripts that set values sourced from external files to be specified. This is especially useful for:

  • Avoiding setting sensitive information, such as usernames, passwords, keys, etc., in the apoc.conf file as plain text.

  • Handling the configuration settings of instances running in environments where the file system is not accessible.

These scripts can be specified in the apoc.conf file. They must begin with $ and be within parentheses (). For example: apoc.setting=$(script_to_execute).

APOC leverages Neo4j’s command expansion capability. See the Operations Manual → The Neo4j conf. file for more information.

To enable command expansions, Neo4j must be started with the argument --expand-commands.

bin/neo4j start --expand-commands

If the startup script does not receive the --expand-commands argument, commands in the configuration file are treated as invalid settings.