Aims. Aiming at studying the physical properties of Galactic IR bubbles and to explore their impact in triggering massive star formation, we perform a multiwavelength analysis of the bubble Hii region Sh2-39 (N5) and its environs. Methods. To analyze the molecular gas we use CO(3-2) and HCO + (4-3) line data obtained with the on-the-fly technique from the ASTE telescope. To study the distribution and physical characteristics of the dust, we make use of archival data from ATLASGAL, Herschel, and MSX, while the ionized gas was studied making use of an NVSS image. We use public WISE, Spitzer, and MSX point source catalogs to search for infrared candidate YSOs in the region. To investigate the stellar cluster [BDS2003]6 we use IR spectroscopic data obtained with the ARCoIRIS spectrograph, mounted on Blanco 4-m Telescope at CTIO, and new available IR Ks band observations from the VVVeXtended ESO Public Survey (VVVX). Results. The new ASTE observations allowed the molecular gas component in the velocity range from 30 km s −1 to 46 km s −1 , associated with Sh2-39, to be studied in detail. The morphology of the molecular gas suggests that the ionized gas is expanding against its parental cloud. We have identified four molecular clumps, that were likely formed by the expansion of the ionization front, and determined some of their physical and dynamical properties. Clumps having HCO + and 870 µm counterparts show evidence of gravitational collapse. We identified several candidate YSOs across the molecular component. Their spatial distribution, as well as the fragmentation time derived for the collected layers of the molecular gas, suggest that massive star formation might have been triggered by the expansion of the nebula via the collect and collapse mechanism. The spectroscopical distance obtained for the stellar cluster [BDS2003]6, placed over one of the collapsing clumps in the border of the Hii region, reveals that this cluster is physically associated with the neabula and gives more support to the triggered massive star formation scenario. A radio continuum data analysis indicates that the nebula is older and expands at lower velocity than typical IR Galactic bubbles.