In response to natural or anthropocentric pollutions coupled to global climate changes, microorganisms from aquatic environments can suddenly accumulate on water surface. These dense suspensions, known as blooms, are harmful to ecosystems and signicantly degrade the quality of water resources. In order to determine the physico-chemical parameters involved in their formation and quantitatively predict their appearance, we successfully reproduced irreversible cyanobacterial blooms in vitro. By combining chemical, biochemical and hydrodynamic evidences, we identify a mechanism, unrelated to the presence of internal gas vesicles, allowing the sudden collective upward migration in test tubes of several cyanobacterial strains (Microcystis aeruginosa PCC 7005, Microcystis aeruginosa PCC 7806 and Synechocystis sp. PCC 6803). The final state consists in a foamy layer of biomass at the air-liquid interface, in which micro-organisms remain alive for weeks, the medium lying below being almost completely depleted of cyanobacteria. These "laboratory blooms" start with the aggregation of cells at high ionic force in cyanobacterial strains that produce anionic extracellular polymeric substances (EPS). Under appropriate conditions of nutrients and light intensity, the high photosynthetic activity within cell clusters leads the dissolved oxygen (DO) to supersaturate and to nucleate into bubbles. Trapped within the EPS, these bubbles grow until their buoyancy pulls the biomass towards the free surface. By investigating a wide range of spatially homogeneous environmental conditions (illumination, salinity, cell and nutrient concentration) we identify species-dependent thresholds and timescales for bloom formation. We conclude on the relevance of such results for cyanobacterial bloom formation in the environment and we propose an ecient method for biomass harvesting in bioreactors.