Light intensity primarily drives plant growth and morphogenesis, whereas the ecological impact of light intensity on the phyllosphere (leaf surface and endosphere) microbiome is poorly understood. In this study, garden lettuce (Lactuca sativa L.) plants were grown under low, medium, and high light intensities. High light intensity remarkably induced the leaf contents of soluble proteins and chlorophylls, whereas it reduced the contents of leaf nitrate. In comparison, medium light intensity exhibited the highest contents of soluble sugar, cellulose, and free amino acids. Meanwhile, light intensity resulted in significant changes in the composition of functional genes but not in the taxonomic compositions of the prokaryotic community (bacteria and archaea) in the phyllosphere. Notably, garden lettuce plants under high light intensity treatment harbored more sulfur-cycling mdh and carbon-cycling glyA genes than under low light intensity, both of which were among the 20 most abundant prokaryotic genes in the leaf phyllosphere. Furthermore, the correlations between prokaryotic functional genes and lettuce leaf metabolite groups were examined to disclose their interactions under varying light intensities. The relative abundance of the mdh gene was positively correlated with leaf total chlorophyll content but negatively correlated with leaf nitrate content. In comparison, the relative abundance of the glyA gene was positively correlated with leaf total chlorophyll and carotenoids. Overall, this study revealed that the functional composition of the phyllosphere prokaryotic community and leaf metabolite groups were tightly linked in response to changing light intensities. These findings provided novel insights into the interactions between plants and prokaryotic microbes in indoor farming systems, which will help optimize environmental management in indoor farms and harness beneficial plant-microbe relationships for crop production.