Let (X,d) be a complete, pathwise connected metric measure space with locally Ahlfors Q-regular measure μ, where Q>1. Suppose that (X,d,μ) supports a (local) (1,2)-Poincaré inequality and a suitable curvature lower bound. For the Poisson equation Δu=f on (X,d,μ), Moser-Trudinger and Sobolev inequalities are established for the gradient of u. The local Hölder continuity with optimal exponent of solutions is obtained.