We describe a phase-field model for the electrodeposition process that forms dendrites within metal-anode batteries. We derive the free energy functional model, arriving at a system of partial differential equations that describe the evolution of a phase field, the lithium-ion concentration, and an electric potential. We formulate, discretize, and solve the set of partial differential equations describing the coupled electrochemical interactions during a battery charge cycle using an open-source finite element library. The open-source library allows us to use parallel solvers and time-marching adaptivity. We describe two- and three-dimensional simulations; these simulations agree with experimentally-observed dendrite growth rates and morphologies reported in the literature.