The author introduces the notion of a Galois extension of commutative $S$-algebras ($E infty$ ring spectra), often localized with respect to a fixed homology theory. There are numerous examples, including some involving Eilenberg-Mac Lane spectra of commutative rings, real and complex topological $K$-theory, Lubin-Tate spectra and cochain $S$-algebras. He establishes the main theorem of Galois theory in this generality. Its proof involves the notions of separable and etale extensions of commutative $S$-algebras, and the Goerss-Hopkins-Miller theory for $E infty$ mapping spaces. He shows that the global sphere spectrum $S$ is separably closed, using Minkowski's discriminant theorem, and he estimates the separable closure of its localization with respect to each of the Morava $K$-theories. He also defines Hopf-Galois extensions of commutative $S$-algebras and studies the complex cobordism spectrum $MU$ as a common integral model for all of the local Lubin-Tate Galois extensions.