We study p-harmonic functions in complete metric spaces equipped with a doubling Borel measure supporting a weak (1, p)-Poincaré inequality, 1 < p < ∞. We establish the barrier classification of regular boundary points from which it also follows that regularity is a local property of the boundary. We also prove boundary regularity at the fixed (given) boundary for solutions of the one-sided obstacle problem on bounded open sets. Regularity is further characterized in several other ways. Our results apply also to Cheeger p-harmonic functions and in the Euclidean setting to script A sign-harmonic functions, with the usual assumptions on script A sign.