We have measured the elemental abundances of 68 Galactic and Magellanic Cepheids from FEROS and UVES high-resolution and high signal-to-noise spectra in order to establish the influence of the chemical composition on the properties of these stars ( see 24 ) . Here we describe the robust analytical procedure we have developed to accurately determine them . The resulting iron abundances span a range between \sim - 0.80 dex for stars in the Small Magellanic Cloud and \sim +0.20 dex for the most metal-rich ones in the Galaxy . While the average values for each galaxy are in good agreement with non-pulsating stars of similar age , Cepheids display a significant spread . Thus it is fundamental to measure the metallicity of individual stars .