How microbial communities respond to extreme conditions in the stratosphere remains unclear. To test this effect, cyanobacterial crusts collected from Tengger Desert were mounted to high balloons and briefly exposed (140 min) to high UV irradiation and low temperature in the stratosphere at an altitude of 32 km. Freezing and thawing treatments were simulated in the laboratory in terms of the temperature fluctuations during flight. Microbial community composition was characterized by sequencing at the level of DNA and RNA. After exposure to the stratosphere, the RNA relative abundances of Kallotenue and Longimicrobium increased by about 2-fold, while those of several dominant cyanobacteria genera changed slightly. The RNA relative abundances of various taxa declined after freezing, but increased after thawing, whereas cyanobacteria exhibited an opposite change trend. The DNA and RNA relative abundances of Nitrososphaeraceae were increased by 1.4~2.3-fold after exposure to the stratosphere or freezing. Exposure to stratospheric environmental conditions had little impact on the total antioxidant capacity, photosynthetic pigment content, and photosynthetic rate, but significantly increased the content of exopolysaccharides by 16%. The three treatments (stratospheric exposure, freezing, and thawing) increased significantly the activities of N-acetyl-β-D-glucosidase (26~30%) and β-glucosidase (14~126%). Our results indicated cyanobacterial crust communities can tolerate exposure to the stratosphere. In the defense process, extracellular organic carbon degradation and transformation play an important role. This study makes the first attempt to explore the response of microbial communities of cyanobacterial crusts to a Mars-like stratospheric extreme environment, which provides a new perspective for studying the space biology of earth communities.