  In this paper, we constrain the density of the interstellar medium (ISM)
around the hadronic PeVatron candidate, supernova remnant (SNR) G106.3+2.7,
based on X-ray and $\gamma$-ray observations. The purpose of this investigation
is to understand the influence of the gaseous environment on this SNR as a
proton PeVatron candidate. By modelling the self-regulated propagation of the
CRs injected from the SNR, we calculate the $\gamma$-ray emission of CRs via
the hadronuclear interactions with the molecular cloud and the ISM, and use the
measured $\gamma$-ray flux to constrain the ISM density around the SNR. Our
results support the picture that the SNR is expanding into a low-density
($n<0.05 cm^{-3}$) cavity, enabling the SNR to be a potential proton PeVatron
despite that it presently is not in the very early phase.
