The formula is only valid when the real part of s is greater than 1. However, the function ζ(s) defined in that way is analytic, and it can be extended by analytic continuation to the rest of the complex plane except for the point s=1 where there is a simple pole. You can find more details about the construction here.