We show that, in general, any complex weakly nonlinear highly multimode system can reach thermodynamic equilibrium, characterized by a unique temperature and chemical potential. The conditions leading to either positive or negative temperatures are explicitly obtained in terms of the linear spectrum of the system, the input power, and the corresponding Hamiltonian invariant. Pertinent examples illustrating these results are provided in various scenarios.