We introduce DeepDFT, a deep learning model for predicting the electronic charge density around atoms, the fundamental variable in electronic structure simulations from which all ground state properties can be calculated. The model is formulated as neural message passing on a graph, consisting of interacting atom vertices and special query point vertices for which the charge density is predicted. The accuracy and scalability of the model are demonstrated for molecules, solids and liquids. The trained model achieves lower average prediction errors than the observed variations in charge density obtained from density functional theory simulations using different exchange correlation functionals.