Shotgun metagenome sequencing provides the opportunity to recover underexplored rare populations and identify difficult-to-elucidate biochemical pathways. However, information on sulfur genes, including their sequences, is scattered in public databases. Here, we introduce SMDB (https://smdb.gxu.edu.cn/)—a manually curated database of sulfur genes based on an in-depth review of the scientific literature and orthology database. The SMDB contained a total of 175 genes and covered 11 sulfur metabolism processes with 395,737 representative sequences affiliated with 110 phyla and 2340 genera of bacteria/archaea. The SMDB was applied to characterize the sulfur cycle from five habitats and compared the microbial diversity of mangrove sediments with that of other habitats. The structure and composition of microorganism communities and sulfur genes were significantly different among the five habitats. Our results show that microorganism alpha diversity in mangrove sediments was significantly higher than in other habitats. Genes involved in dissimilatory sulfate reduction were abundant in subtropical marine mangroves and deep-sea sediments. The neutral community model results showed that microbial dispersal was higher in the marine mangrove ecosystem than in others habitats. TheFlavilitoribacterof sulfur-metabolizing microorganism becomes a reliable biomarker in the five habitats. SMDB will assist researchers to analyze genes of sulfur cycle from the metagenomic efficiently.