We propose an approach to the numerical simulation of thin-film flows based on the lattice Boltzmann method. We outline the basic features of the method, show in which limits the expected thin-film equations are recovered, and perform validation tests. The numerical scheme is applied to the viscous Rayleigh-Taylor instability of a thin film and to the spreading of a sessile drop toward its equilibrium contact angle configuration. We show that the Cox-Voinov law is satisfied and that the effect of a tunable slip length on the substrate is correctly captured. We address, then, the problem of a droplet sliding on an inclined plane, finding that the Capillary number scales linearly with the Bond number, in agreement with experimental results. At last, we demonstrate the ability of the method to handle heterogenous and complex systems by showcasing the controlled dewetting of a thin film on a chemically structured substrate.