Making use of the osmotic pressure difference between fresh water and seawater is an attractive, renewable and clean way to generate power and is known as ‘blue energy’1,2,3. Another electrokinetic phenomenon, called the streaming potential, occurs when an electrolyte is driven through narrow pores either by a pressure gradient4or by an osmotic potential resulting from a salt concentration gradient5. For this task, membranes made of two-dimensional materials are expected to be the most efficient, because water transport through a membrane scales inversely with membrane thickness5,6,7. Here we demonstrate the use of single-layer molybdenum disulfide (MoS2) nanopores as osmotic nanopower generators. We observe a large, osmotically induced current produced from a salt gradient with an estimated power density of up to 106 watts per square metre—a current that can be attributed mainly to the atomically thin membrane of MoS2. Low power requirements for nanoelectronic and optoelectric devices can be provided by a neighbouring nanogenerator that harvests energy from the local environment8,9,10,11—for example, a piezoelectric zinc oxide nanowire array8or single-layer MoS2 (ref.12). We use our MoS2 nanopore generator to power a MoS2 transistor, thus demonstrating a self-powered nanosystem.