Context. FU Orionis (FUor) and EX Lupi (EXor) type objects represent two small but rather spectacular groups of low-mass, young, eruptive stars. In both cases, outbursts of several magnitudes are observed, which are attributed to enhanced mass accretion from the circumstellar disc onto the central protostar. Although these objects are well studied at optical and near-infrared wavelengths, their host molecular environments are poorly explored because of the scarcity of systematic molecular line observations. Aims. We aim to carry out the first dedicated survey of the molecular environments of a large sample of FUors and EXors, observing a total of 51 sources, including some Gaia alerts, to study the ammonia (NH 3 ) emission in their host environments. Methods. We observed the ammonia (J, K)=(1,1), (2,2), and (3,3) inversion transitions at ∼23.7 GHz in position-switching mode using the Effelsberg 100-m radio telescope. For 19 of the 51 sources in our sample, we derived H 2 column densities and dust temperatures using archival Herschel SPIRE data at 250 µm, 300 µm, and 500 µm. Results. We detected the NH 3 (1,1) transition toward 28 sources and the (2,2) transition toward 12 sources, while the (3,3) transition was detected towards only two sources in our sample. We find kinetic temperatures between ∼12 K and 21 K, ammonia column densities from 5.2 × 10 13 cm −2 to 3.2 × 10 15 cm −2 , and fractional ammonia abundances with respect to H 2 from 4.7 × 10 −9 to 1.5 × 10 −7 . These results are comparable to those found in infrared dark clouds (IRDCs). Our kinematic analysis suggests that most of the eruptive stars in our sample reside in rather quiescent (sonic or transonic) host environments. Conclusions. Our NH 3 observations and analysis of the SPIRE dust-based H 2 column density maps confirm the presence of dense material towards seven sources in our sample; additional sources might also harbour dense gas based on their NH 2 (2,2) detections, potentially indicating an earlier phase than originally classified. Based on our results, we suggest that observations targeting additional molecular lines would help to refine the evolutionary classification of eruptive stars.