1. Climate, topography and the 3D structure of forests are major drivers affecting local species communities. However, little is known about how the specific functional traits of saproxylic (wood-living) beetles, involved in the recycling of wood, might be affected by those environmental characteristics.2. Here, we combine ecological and morphological traits available for saproxylic beetles and airborne laser scanning (ALS) data in Bayesian trait-based joint species distribution models to study how traits drive the distributions of more than 230 species in temperate forests of Europe.3. We found that elevation (as a proxy for temperature and precipitation) and the proportion of conifers played important roles in species occurrences while variables related to habitat heterogeneity and forest complexity were less relevant. Furthermore, we showed that local communities were shaped by environmental variation primarily through their ecological traits whereas morphological traits were involved only marginally. As predicted, ecological traits influenced species' responses to forest structure, and to other environmental variation, with canopy niche, wood decay niche and host preference as the most important ecological traits. Conversely, no links between morphological traits and environmentalThis is an open access article under the terms of the Creative Commons Attribution-NonCommercial-NoDerivs License, which permits use and distribution in any medium, provided the original work is properly cited, the use is non-commercial and no modifications or adaptations are made.