PENTATRAP is a mass spectrometer consisting of five Penning traps aiming for mass-ratio measurements of long-lived, highly-charged ions to a relative precision of below 10−11 by determining the cyclotron frequencies of trapped ions in a strong magnetic field. At this level of precision, mass-ratio determinations contribute, among others, to neutrino physics and a direct test of special relativity. In order to reach this goal, the systematic uncertainties of the cyclotron frequency measurement originating from environmental influences, including magnetic field, pressure, and temperature fluctuations, have to be precisely known and avoided. In the framework of this thesis, the main sources of magnetic field changes have been identified and an active magnetic field stabilization system was constructed and tested. The temperature was optimized to a stability of 20 mK/h and the temperature dependence of the voltage source for the trapping potentials of the measurement traps was determined to be 2.43(14) · 10−6/K and less. A helium-level and cold-bore pressure stabilization system has been installed and successfully tested, reducing the fluctuations of the magnetic trapping field to a nearly constant relative drift of −2 · 10−10/h. With the achieved control over the environmental influences the first cyclotron frequency measurements of 187Re/187Re to a relative precision of 8 · 10−12 have been carried out