The free energy principle (FEP) claims that self-organization in biological agents is driven by variational free energy (FE) minimization in a generative probabilistic model of the agent’s environment [6]. Research progress in this field relies substantially on the capability to simulate biologically plausible FE minimization processes in postulated generative neural models. To this end, we have developed ForneyLab as a free and open source toolbox for FE minimization by variational message passing in freely definable probabilistic dynamic models. ForneyLab is released as a package for the open source scientific programming language Julia, which combines a MATLAB-like syntax and native speed close to that of (compiled) C code. ForneyLab is based on the formalism of Forney-style factor graphs (FGGs), which facilitates a very modular (plug-in) design approach and automated derivation of biologically plausible message passing-based inference algorithms.