High-purity germanium (HPGe) detectors are well suited to analyse the radioactivity of samples. In order to reduce the environmental background for an ultra-low background HPGe spectrometer, low-activity lead and oxygen free copper are installed outside the probe to shield from gamma radiation, with an outer plastic scintillator to veto cosmic rays, and an anti-Compton detector to improve the peak-to-Compton ratio. Using Geant4 tools and taking into account a detailed description of the detector, we optimize the sizes of these detectors to reach the design requirements. A set of experimental data from an existing HPGe spectrometer was used to compare with the simulation. For the future low-background HPGe detector simulation, considering different thicknesses of BGO crystals and anti-coincidence efficiency, the simulation results show that the optimal BGO thickness is 5.5 cm, and the peak-to-Compton ratio of 40K is raised to 1000 when the anti-coincidence efficiency is 0.85. In the background simulation, 15 cm oxygen-free copper plus 10 cm lead can reduce the environmental gamma rays to 0.0024 cps/100 cm3 Ge (50 keV-2.8 MeV), which is about 10−5 of the environmental background.