The paper introduces a new formulation of the dynamic subgrid-scale model, which minimizes the error associated with the Germano identity along flow pathlines rather than over directions of statistical homogeneity. This approach allows the model to be applied to complex geometries without the need for homogeneous directions. The Lagrangian time scale is chosen to ensure numerical stability when coupled with the Smagorinsky model. The model is tested in forced and decaying isotropic turbulence, as well as in fully developed and transitional channel flow. Results show that the model performs similarly to the volume-averaged dynamic model in homogeneous flows but outperforms it in channel flow. The relationship between the averaged terms in the model and vortical structures (worms) in LES is investigated. The computational overhead is kept low by using an approximate scheme for Lagrangian tracking and linear interpolation in space. The Lagrangian dynamic model is shown to produce results comparable to or superior to those of spatially-averaged models, with only a 10% increase in CPU time.The paper introduces a new formulation of the dynamic subgrid-scale model, which minimizes the error associated with the Germano identity along flow pathlines rather than over directions of statistical homogeneity. This approach allows the model to be applied to complex geometries without the need for homogeneous directions. The Lagrangian time scale is chosen to ensure numerical stability when coupled with the Smagorinsky model. The model is tested in forced and decaying isotropic turbulence, as well as in fully developed and transitional channel flow. Results show that the model performs similarly to the volume-averaged dynamic model in homogeneous flows but outperforms it in channel flow. The relationship between the averaged terms in the model and vortical structures (worms) in LES is investigated. The computational overhead is kept low by using an approximate scheme for Lagrangian tracking and linear interpolation in space. The Lagrangian dynamic model is shown to produce results comparable to or superior to those of spatially-averaged models, with only a 10% increase in CPU time.