Abstract We derive Green-Kubo relations for the viscosities of a nematic liquid crystal. The derivation is based on the application of a Gaussian constraint algorithm that makes the director angular velocity of a liquid crystal a constant of motion. Setting this velocity equal to zero means that a director-based coordinate system becomes an inertial frame and that the constraint torques do not do any work on the system. The system consequently remains in equilibrium. However, one generates a different equilibrium ensemble. The great advantage of this ensemble is that the Green-Kubo relations for the viscosities become linear combinations of time correlation function integrals, whereas they are complicated rational functions in the conventional canonical ensemble. This facilitates the numerical evaluation of the viscosities by molecular dynamics simulations.