The effective potential of the order parameter for confinement is calculated
for SU(N) Yang--Mills theory in the Hamiltonian approach. Compactifying one
spatial dimension and using a background gauge fixing, this potential is
obtained within a variational approach by minimizing the energy density for
given background field. In this formulation the inverse length of the
compactified dimension represents the temperature. Using Gaussian trial wave
functionals we establish an analytic relation between the propagators in the
background gauge at finite temperature and the corresponding zero-temperature
propagators in Coulomb gauge. In the simplest truncation, neglecting the ghost
and using the ultraviolet form of the gluon energy, we recover the Weiss
potential. We explicitly show that the omission of the ghost drastically
increases the transition temperature. From the full non-perturbative potential
(with the ghost included) we extract a critical temperature of the
deconfinement phase transition of 269 MeV for the gauge group SU(2) and 283 MeV
for SU(3).Comment: 26 pages, 17 eps figure