We study, for a locally compact group G, the compactifications (π, G π ) associated with unitary representations π, which we call π-Eberlein compactifications. We also study the Gelfand spectra Φ A(π) of the uniformly closed algebras A(π) generated by matrix coefficients of such π. We note that Φ A(π) ∪ {0} is itself a semigroup and show that theŠilov boundary of A(π) is G π . We study containment relations of various uniformly closed algebras generated by matrix coefficients, and give a new characterisation of amenability: the constant function 1 can be uniformly approximated by matrix coefficients of representations weakly contained in the left regular representation if and only if G is amenable. We show that for the universal representation ω, the compactification (ω, G ω ) has a certain universality property: it is universal amongst all compactifications of G which may be embedded as contractions on a Hilbert space, a fact which was also recently proved by Megrelishvili [48]. We illustrate our results with examples including various abelian and compact groups, and the ax + b-group. In particular, we witness algebras A(π), for certain non-self-conjugate π, as being generalised algebras of analytic functions.