Energy use, mainly to reverse ion movements in neurons, is a fundamental constraint on brain information processing. Trafficking of mitochondria to locations in neurons where there are large ion fluxes is essential for powering neural function. Mitochondrial trafficking is regulated by Ca2+ entry through ionotropic glutamate receptors, but the underlying mechanism is unknown. We show that the protein Miro1 links mitochondria to KIF5 motor proteins, allowing mitochondria to move along microtubules. This linkage is inhibited by micromolar levels of Ca2+ binding to Miro1. With the EF hand domains of Miro1 mutated to prevent Ca2+ binding, Miro1 could still facilitate mitochondrial motility, but mitochondrial stopping induced by glutamate or neuronal activity was blocked. Activating neuronal NMDA receptors with exogenous or synaptically released glutamate led to Miro1 positioning mitochondria at the postsynaptic side of synapses. Thus, Miro1 is a key determinant of how energy supply is matched to energy usage in neurons.