Electrostatic gates by ion liquid (IL) or ion gel (IG) have allowed the exploration of intriguing material properties that are related to heavy charge doping in low‐dimensional materials. However, the obtained gate modulation is usually volatile at room temperature due to the recovery of ion position when removing the gate bias, which hinders their application in practical functional devices. Herein, the electrochemical IG gate is explored, and a nonvolatile modulation of the doping polarity of MoTe2 (from n to p and reversibly to n) by exploiting the electrochemical hydrolysis of residual water in IG and the subsequent chemical ion adsorption on MoTe2 is demonstrated. Further, based on the asymmetrically coupled gate bias to source and drain terminals, a lateral pn diode is prepared with long‐term stability >5 × 104 s and a self‐powered responsivity >85 mA W−1 at the near‐infrared wavelength of 1050 nm. The performance of diode is further optimized by applying a slight gate bias that tunes the width, position of space charge region in junction, and the overall charge collection efficiency. The nonvolatile electrochemical IG gate thus offers a viable pathway toward 2D low‐power photodetectors in the infrared spectra range.