Deterministic and stochastic processes are believed to play a combined role in microbial community assembly, though little is known about the factors determining their relative importance. We investigated the effect of biofilm thickness on community assembly in nitrifying moving bed biofilm reactors using biofilm carriers where maximum biofilm thickness is controlled. We examined the contribution of stochastic and deterministic processes to biofilm assembly in a steady state system using neutral community modelling and community diversity analysis with a null-modelling approach. Our results indicate that the formation of biofilms results in habitat filtration, causing selection for phylogenetically closely related community members, resulting in a substantial enrichment of Nitrospira spp. in the biofilm communities. Stochastic assembly processes were more prevalent in biofilms of 200 µm and thicker, while stronger selection in thinner (50 µm) biofilms could be driven by hydrodynamic and shear forces at the biofilm surface. Thicker biofilms exhibited greater phylogenetic beta-diversity, which may be driven by a variable selection regime caused by variation in environmental conditions between replicate carrier communities, or by drift combined with low migration rates resulting in stochastic historical contingency during community establishment. Our results indicate that assembly processes vary with biofilm thickness, contributing to our understanding of biofilm ecology and potentially paving the way towards strategies for microbial community management in biofilm systems.