Long-term infection of the stomach with Helicobacter pylori can cause gastric cancer. However, the mechanisms by which the bacteria adapt to the stomach environment are poorly understood. Here, we show that a small non-coding RNA of H. pylori (HPnc4160, also known as IsoB or NikS) regulates the pathogen's adaptation to the host environment as well as bacterial oncoprotein production. In a rodent model of H. pylori infection, the genomes of bacteria isolated from the stomach possess an increased number of T-repeats upstream of the HPnc4160-coding region, and this leads to reduced HPnc4160 expression. We use RNA-seq and iTRAQ analyses to identify eight targets of HPnc4160, including genes encoding outer membrane proteins and oncoprotein CagA. Mutant strains with HPnc4160 deficiency display increased colonization ability of the mouse stomach, in comparison with the wild-type strain. Furthermore, HPnc4160 expression is lower in clinical isolates from gastric cancer patients than in isolates derived from non-cancer patients, while the expression of HPnc4160's targets is higher in the isolates from gastric cancer patients. Therefore, the small RNA HPnc4160 regulates H. pylori adaptation to the host environment and, potentially, gastric carcinogenesis.