We explore how habitat impacts fungal community composition, and test hypotheses for how environment and microbial compositional variation influence the rate and process of wood decay. We use a decomposition experiment anchoring standardized sections of wood from a single tree species along replicated gradients of salinity, and in adjacent terrestrial habitats. Large differences in fungal communities at the order and phylum-level were observed in this study, consistent with previous taxonomic studies of aquatic fungi. We show that these compositional differences are associated with marked differences in wood elemental concentrations and in the loss rates of wood polymers, indicating that a combination of biotic and abiotic factors associated with habitat can drive differences in decay processes.