Skip to content

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.


Dependencies: Installing Lua using the steps below requires rsync, make and gcc

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)


Dependencies: building Lmod using the steps below requires tcl, tcl-dev(el), make and bzip2

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

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

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/8.4/libexec:$PATH

Optionally, give it a spin:

$ lmod --version

Modules based on Lua: Version 8.4  2020-07-31 12:25 -05:00
    by Robert McLay

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

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