In a deep aquifer associated with an accretionary prism, significant methane (CH4) is produced by a subterranean microbial community. Here, we developed a bioreactor that can switch between CH4 and hydrogen (H2) using anaerobic groundwater collected from the deep aquifer. To generate CH4, the anaerobic groundwater amended with organic substrates was incubated in the bioreactor. At first, H2 was detected and accumulated in the gas phase of the bioreactor. After the H2 decreased, rapid CH4 production was observed. Next generation sequencer (NGS) analysis of 16S rRNA genes revealed that the H2-producing fermentative bacteria and hydrogenotrophic methanogen were predominant in the reactor. The results suggested that syntrophic biodegradation of organic substrates by the H2-producing fermentative bacteria and the hydrogenotrophic methanogen contributed to the CH4 production. For H2 production, the anaerobic groundwater amended with organic substrates was incubated at higher temperature than the temperature of CH4 production. After incubation for 169 h, H2 was detected from the gas phase of the bioreactor and accumulated. Next generation sequencer (NGS) analysis of 16S rRNA genes suggested the dominance of the H2-producing fermentative bacteria and inhibition of hydrogenotrophic methanogen in the reactor. Our study demonstrated a simple H2 production utilizing anaerobic groundwater containing an active subterranean microbial community without inhibitor of methanogens.