Dung beetles are a functionally important component of most terrestrial ecosystems, but communities change with habitat disturbance and deforestation. In this study, we tested if dung beetle ensembles on dung of introduced cattle and of the endemic anoa, a small buffalo, are affected differentially by habitat disturbance. Therefore, we exposed 10 pitfall traps, five baited with anoa and five baited with cattle dung, per site in six habitat types ranging from natural and selectively logged rain forest to three types of agroforestry system (characterized by different management intensity) and open areas (n = 4 replicate sites per habitat type) at the margin of Lore Lindu National Park, Central Sulawesi, Indonesia. We found 28 species, 43% of which were endemic to Sulawesi. Species richness, abundance and biomass declined from natural forest towards open area. Large-bodied species appeared to be more sensitive to habitat disturbance and the ratio of large to small-sized dung beetles declined with land-use intensity. Although selectively logged forest and cocoa agroforestry systems had lower species richness compared with natural forest, they appeared to maintain a high portion of species originally inhabiting forest sites. The similarity of dung beetle ensembles recorded at forest and agroforestry sites reflects the high similarity of some habitat variables (e.g. vegetation structure and microclimate) between both habitat types compared with open areas. Species richness and abundances as well as species composition, which was characterized by decreases in mean body size, changed with land-use intensity, indicating that dung type is less important than habitat type for determining ensemble structure of these Indonesian dung beetles.