Installing Lmod without root permissions

This short guide will show how to install Lmod (and Lua, on which it depends) on Linux, without requiring root permissions.


Build and install Lua using the source tarball available in the Lmod SourceForge repository ( This version is a lot easier to build, and already includes the required extra Lua modules. At the time of writing this relates to the lua- tarball.

Step 1: Download and unpack lua-

Step 2: Configure the Lua build, provide a custom installation prefix (e.g. $HOME/lua) and specify to statically link libraries (i.e. libreadline and ncurses), to avoid problems when modules that provide these libraries are being loaded. Then build and install via make:

./configure --with-static=yes --prefix=$HOME/lua && make && make install

Step 3: Make sure the lua binary is available in your $PATH (only required when building Lmod, see below):

export PATH=$HOME/lua/bin:$PATH

Optionally, check whether the lua binary indeed doesn’t link to any unexpected readline or ncurses libraries:

$ ldd $HOME/lua/bin/lua (0x00007fffad7ff000) => /lib64/ (0x00007ff9914db000) => /lib64/ (0x00007ff9912d7000) => /lib64/ (0x00007ff990f2a000)
        /lib64/ (0x00007ff9917d9000)


Step 1: Download and unpack the latest available Lmod version, Lmod-6.1.tar.bz2 at the time of writing.

tar xfvj Lmod-6.1.tar.bz2 && cd Lmod-6.1

Step 2: Configure, build and install Lmod build, in a custom prefix:

./configure --prefix=$HOME && make install

Step 3: Update $PATH so lmod is available (put this in your .bashrc):

export PATH=$HOME/lmod/6.1/libexec:$PATH

Optionally, give it a spin:

$ lmod --version

Modules based on Lua: Version 6.1  2016-02-05 16:31
    by Robert McLay

Step 4: Define module function to use lmod (optional for use with EasyBuild):

source $HOME/lmod/6.1/init/bash
export LMOD_CMD=$HOME/lmod/6.1/libexec/lmod