The number of smokers worldwide increased greatly during the past decades and reached 1.14 billion in 2019, becoming a leading risk factor for human health. Tobacco smoking has wide effects on human genetics, epigenetics, transcriptome, and gut microbiome. Although many studies have revealed effects of smoking on host transcriptome, research on the relationship between smoking, host gene expression, and the gut microbiome is limited. We first explored transcriptome and metagenome profile differences between smokers and nonsmokers. To evaluate the relationship between host gene expression and gut microbiome, we then applied bidirectional mediation analysis to infer causal relationships between smoking, gene expression, and gut microbes. Metagenome and transcriptome analyses revealed 71 differential species and 324 differential expressed genes between smokers and nonsmokers. With smoking as an exposure variable, we identified 272 significant causal relationships between gene expression and gut microbes, among which there were 247 genes that mediate the effect of smoking on gut microbes. Pathway-based enrichment analysis showed that these genes were significantly enriched in heme metabolic pathway, which mainly mediated the changes of Bacteroides finegoldii and Lachnospiraceae bacterium 9_1_43BFAA. Additionally, by performing metabolome data analysis in the Integrated Human Microbiome Project (iHMP) database, we verified the correlation between the intermediate products of the heme metabolism pathway (porphobilinogen, bilirubin, and biliverdin) and gut microbiome. By investigating the bidirectional interaction between smoking-related host gene expression and gut microbes, this study provided evidence for the mediation of smoking on gut microbes through co-involvement or interaction of heme metabolism. By comparing the metagenome and transcriptome sequencing profiles between 34 smokers and 33 age- and gender-matched nonsmokers, we are the first to reveal causal relationships among tobacco smoking, host gene expression, and gut microbes. These findings offer insight into how smoking affects gut microbes through host gene expression and metabolism, which highlights the importance of heme metabolism in modulating the effects of smoking on gut microbiome.