We extend the stability analysis of incompressible Kolmogorov flow, induced by a spatially periodic external force in an unbounded domain, to a compressible hardsphere gas confined between two parallel isothermal walls. The two-dimensional problem is studied by means of temporal stability analysis of a 'slip flow' continuumlimit model and the direct simulation Monte Carlo (DSMC) method. The neutral curve is obtained in terms of the Reynolds (Re) and Knudsen (Kn) numbers, for a given non-dimensional wavenumber (2πn) of the external force. In the incompressible limit (Kn, Kn Re → 0), the problem is governed only by the Reynolds number, and our neutral curve coincides with the critical Reynolds number (Re cr ) calculated in previous incompressible analyses. Fluid compressibility (Kn, Kn Re = 0) affects the flow field through the generation of viscous dissipation, coupling flow shear rates with irreversible heat production, and resulting in elevated bulk-fluid temperatures. This mechanism has a stabilizing effect on the system, thus increasing Re cr (compared to its incompressible value) with increasing Kn. When compressibility effects become strong enough, transition to instability changes type from 'exchange of stabilities' to 'overstability', and perturbations are dominated by fluctuations in the thermodynamic fields. Most remarkably, compressibility confines the instability to small (O(10 −3 )) Knudsen numbers, above which the Kolmogorov flow is stable for all Re. Good agreement is found between 'slip flow' and DSMC analyses, suggesting the former as a useful alternative in studying the effects of various parameters on the onset of instability, particularly in the context of small Knudsen numbers considered.