Phase retrieval deals with the recovery of complex- or real-valued signals from magnitude measurements. Virtually all recently proposed phase retrieval algorithms rely on so-called spectral initialization methods which provide an accurate starting point for iterative phase retrieval methods. We propose a novel spectral initializer that relies on a linear estimation procedure. Our method, called PhaseInit, is a linear spectral estimator that minimizes the mean squared error (MSE) when applied to the magnitude measurements. Our initializer enables an nonasymptotic MSE analysis for arbitrary, deterministic measurement matrices, and we demonstrate the efficacy of PhaseInit on synthetic as well as real-world data.