File and Directory Locations
Overview
Every RabbitMQ node uses a number of files and directories to load configuration: store data, metadata, log files, and so on. Their location can be changed.
This guide covers:
- How to customise location of various directories and files used RabbitMQ nodes
- Default locations of key files and directories on various operating systems
- Other topics related to file and directory locations
This guide accompanies the main Configuration guide.
Overriding Locations
A number of environment variables specifies where RabbitMQ should locate certain things. In most environments default values should work just fine.
Path and Directory Name Restrictions
Some of the environment variable configure paths and locations (node's base or data directory, plugin source and expansion directories, and so on). Those paths have must exclude a number of characters:
*
and?
(on Linux, macOS, BSD and other UNIX-like systems)^
and!
[
and]
{}
and}
The above characters will render the node unable to start or function as expected (e.g. load plugin code modules and other files).
Required File and Directory Permissions
When changing file or directory locations, it is important to make sure that they have sufficient permissions for RabbitMQ node OS process to read and write from. It's best to assume that most directories and files used by RabbitMQ require read, write, and file creation permissions.
Debian, RPM, Homebrew and Windows installer packages will set up file system permissions suitable for most environments, however, when strict default permissions are used system-wide, it may be necessary to run additional configuration steps after installation to make sure RabbitMQ node file and directories have sufficient permissions
Environment Variables
Name | Description |
---|---|
RABBITMQ_BASE | Note: Windows-specific. This base directory contains sub-directories for the RabbitMQ server's database and log files. Instead of overriding RABBITMQ_MNESIA_BASE and RABBITMQ_LOG_BASE individually, it may be easier to override the base directory instead. |
RABBITMQ_CONFIG_FILE | The path to the configuration file, without
the |
RABBITMQ_CONFIG_FILES | Path to a directory of RabbitMQ configuration files in the new-style (.conf) format. The files will be loaded in alphabetical order. Prefixing each files with a number is a common practice. See Configuration guide for more information. |
RABBITMQ_MNESIA_BASE | This base directory contains sub-directories for the RabbitMQ
server's node database, message store and cluster state files, one for each node,
unless RABBITMQ_MNESIA_DIR is set explicitly.
It is important that effective RabbitMQ user has sufficient permissions
to read, write and create files and subdirectories in this directory
at any time.
This variable is typically not overridden. Usually |
RABBITMQ_MNESIA_DIR | The directory where this RabbitMQ node's data is stored. This includes a schema database, message stores, cluster member information and other persistent node state. |
RABBITMQ_SCHEMA_DIR | The directory where RabbitMQ keeps its configuration schema used by the new style configuration file. |
RABBITMQ_LOG_BASE | This base directory contains the RabbitMQ server's log files, unless RABBITMQ_LOGS is set. |
RABBITMQ_LOGS | The path of the RabbitMQ server's Erlang log file. This variable cannot be overridden on Windows. |
RABBITMQ_PLUGINS_DIR | The list of directories where plugin archive files are located and extracted
from. This is |
RABBITMQ_PLUGINS_EXPAND_DIR | Working directory used to expand enabled plugins when starting the server. It is important that effective RabbitMQ user has sufficient permissions to read and create files and subdirectories in this directory. |
RABBITMQ_ENABLED_PLUGINS_FILE | This file records explicitly enabled plugins. When a plugin is enabled or disabled, this file will be recreated. It is important that effective RabbitMQ user has sufficient permissions to read, write and create this file at any time. |
RABBITMQ_PID_FILE | File in which the process id is placed for use by
|
Default Locations on Linux, macOS, BSD
In the following table the ${install_prefix}
to
some paths is indicated. Debian and RPM package installations use an empty
${install_prefix}
.
Homebrew installations use the
installation-prefix (Homebrew Cellar) when installed. By
default this is /opt/homebrew
on Apple Silicon-based Macs.
Name | Location |
---|---|
RABBITMQ_BASE | (Not used - Windows only) |
RABBITMQ_CONFIG_FILE |
|
RABBITMQ_MNESIA_BASE |
|
RABBITMQ_MNESIA_DIR |
|
RABBITMQ_LOG_BASE |
|
RABBITMQ_LOGS |
|
RABBITMQ_PLUGINS_DIR |
Note that |
RABBITMQ_PLUGINS_EXPAND_DIR |
|
RABBITMQ_ENABLED_PLUGINS_FILE |
|
RABBITMQ_PID_FILE |
|
Default Locations on Windows
Name | Location |
---|---|
RABBITMQ_BASE |
|
RABBITMQ_CONFIG_FILE |
|
RABBITMQ_MNESIA_BASE |
|
RABBITMQ_MNESIA_DIR |
|
RABBITMQ_LOG_BASE |
|
RABBITMQ_LOGS |
|
RABBITMQ_PLUGINS_DIR | Installation-directory |
RABBITMQ_PLUGINS_EXPAND_DIR |
|
RABBITMQ_ENABLED_PLUGINS_FILE |
|
RABBITMQ_PID_FILE | (Not currently supported) |
Generic Binary Build Defaults
These are the defaults obtained when a generic binary build
archive is unpacked without any modification. In
this table $RABBITMQ_HOME
refers
to the directory produced when extracting the archive.
These paths are not relevant for installation options that use the same package type but heavily customize it, such as the Homebrew formula.
Name | Location |
---|---|
RABBITMQ_BASE | (Not used) |
RABBITMQ_CONFIG_FILE |
|
RABBITMQ_MNESIA_BASE |
|
RABBITMQ_MNESIA_DIR |
|
RABBITMQ_LOG_BASE |
|
RABBITMQ_LOGS |
|
RABBITMQ_PLUGINS_DIR |
|
RABBITMQ_PLUGINS_EXPAND_DIR |
|
RABBITMQ_PID_FILE |
|