We present an efficient exact diagonalization scheme for the extended dynamical mean-field theory and apply it to the extended Hubbard model on the square lattice with nonlocal charge-charge interactions. Our solver reproduces the phase diagram of this approximation with good accuracy. Details on the numerical treatment of the large Hilbert space of the auxiliary Holstein-Anderson impurity problem are provided. Benchmarks with a numerically exact strong-coupling continuoustime quantum-Monte Carlo solver show better convergence behavior of the exact diagonalization in the deep insulator. Special attention is given to possible effects due to the discretization of the bosonic bath. We discuss the quality of real axis spectra and address the question of screening in the Mott insulator within extended dynamical mean-field theory.The description of strong correlations is a challenging topic in the fields of spintronics, nanoelectronics, and molecular electronics. For future applications some typical effects of strong correlations are potentially attractive, such as the Mott metal-insulator transition, 1-5 the Kondo resonance, 6 high-temperature superconductivity, 7 and itinerant ferromagnetism. 8 Mott physics has been suggested for applications in the context of field effect transistors 9 and memory devices. 10 Approaches based on the dynamical mean-field theory (DMFT) 11,12 have been very successful in the description of strong correlations. In case of sufficiently shortranged interactions, strongly correlated systems are often described by an effective Hubbard model. In single-site DMFT one approximates the Hubbard model by solving a local impurity problem instead, where the impurity can be seen as a representative of each single atom of the lattice. The hopping of electrons from the impurity to neighboring atoms and vice versa is modeled by a selfconsistent hybridization of the impurity with an effective bath. For the Hubbard model this description is suitable because the interaction, as well as the dominant correlations, are local. Methods based on DMFT have been used to predict strong correlation effects in real materials. 13,14 Exact diagonalization (ED) has been used early on as a solver for the local reference system of DMFT, the Anderson impurity model. 11,15-19 ED methods operate with a finite Hamiltonian, whose size is a limiting factor to their applicability. As a consequence, the effective hybridization function needs to be "discretized", i.e., the number of energy levels of the bath needs to be finite and small, while it is infinite in the thermodynamic limit. However, few fermionic bath levels are indeed needed to describe the Hubbard model with good precision. 16 The noise-free solution of the Anderson impurity model on the real axis and the absence of any sign problem make ED solvers an alternative in circumstances where Continuous-Time Quantum Monte Carlo (CTQMC) solvers 20 prove unsuit-able.An important focus in the field of strongly correlated materials is taking long-ranged interactions into accoun...