Configuring MarkLogic Server to Run as a Non-Daemon User
- Last Updated: April 21, 2026
- 3 minute read
- MarkLogic Server
- Version 11.0
- Documentation
On UNIX-based systems (Linux), MarkLogic Server runs as the UNIX user named daemon. This section describes how to change a configuration to run as a different UNIX user. This procedure must be run by the root user. Additionally, the root user is still required for installing and uninstalling MarkLogic Server and for starting and stopping MarkLogic Server from the startup scripts.
To modify an installation to run as a user other than daemon, follow these steps:
-
In a command window on the machine in which you installed MarkLogic Server, log in as the
rootuser. -
Edit the configuration file for your platform using a text editor such as
vi.Platform
Configuration file
Red Hat Linux
/etc/marklogic.conf
Note:
You must create the/etc/marklogic.conffile if it does not exist. The file is only read but never written to by the MarkLogic Server startup. Therefore, it survives uninstalling MarkLogic Server. -
In the file
/etc/marklogic.conf, add or edit theMARKLOGIC_USERenvironment variable to point to the user in which you want MarkLogic Server to run. For example, if you want it to run as a user namedraymond, then change this line ...export MARKLOGIC_USER=daemon... to this:
export MARKLOGIC_USER=raymond -
Save the changes to the
/etc/marklogic.conffile. -
If you have not yet started MarkLogic Server after performing a clean installation (that is, after installing into a directory where MarkLogic Server has never been installed), then you are done and you can skip the rest of the steps in this procedure. If you have an existing installation (for example, if you are upgrading to a maintenance release), then continue with these steps:
-
For all of the MarkLogic Server files owned by
daemon, you need to change the owner to the new user. These files include all forest data and all of the configuration files. By default, the forest data is in/var/opt/MarkLogic. -
For example, on a Linux system, perform a command similar to the following, which changes the owner to the user specified earlier in the
/etc/MarkLogic.conffile:chown -R raymond /var/opt/MarkLogic -
Make sure to change the owner for all forests in the system; otherwise, forests will fail to mount upon startup. Note that the above command changes the owner only for forests installed in the default directory. You need to run a similar command on the data directory for each forest in which a data directory is specified.
-
When you have completed all the file and directory ownership changes, start MarkLogic Server.
Once you have performed this procedure, all new files created by MarkLogic Server are created with the new user ownership; there will be no need to change any ownership again.
Warning:
On Linux systems, use the /etc/marklogic.conf script to set environment variables. Any configuration changes you make to the MarkLogic-supplied startup script (for example, /etc/sysconfig/MarkLogic) will not survive an upgrade and need to be merged in during any upgrade of MarkLogic Server (because the installation installs a new version of the startup scripts). Under Linux, the uninstallation process saves an old version of the scripts (for example, /etc/sysconfig/MarkLogic.rpmsave), so you can use that version to merge in your changes. But if you perform a clean installation (not an upgrade installation), then you must run this entire procedure again. If you use /etc/marklogic.conf for your environment variable changes, then they will survive an upgrade and you do not need to merge your changes.
These are the default values of environment variables that you can override in /etc/marklogic.conf on Linux-based systems (you must create the file if it does not exist):
export MARKLOGIC_INSTALL_DIR=/opt/MarkLogic
export MARKLOGIC_DATA_DIR=/var/opt/MarkLogic
export MARKLOGIC_FSTYPE=ext4
export MARKLOGIC_USER=daemon
export MARKLOGIC_PID_FILE=/var/run/MarkLogic.pid
export MARKLOGIC_UMASK=022
export MARKLOGIC_DISABLE_JVM=0
export MARKLOGIC_EC2_HOST
export TZ=:/etc/localtime