The compressor has a piston (32) and a housing (11,12) with a crank chamber (15) and a cylinder bore (31) to receive the piston. A drive unit (21) is operatively linked to the piston to convert a rotation of a drive shaft (16) to a reciprocating motion. A head (33) with a sealing surface (33a) is formed at one end of the cylinder and an edge (34) is formed at the other end of the cylinder, which is coupled with the drive unit. A restrictor between the edge and the housing wall defines the rotation of the piston about its axis (P) relative to the cylinder bore. The restrictor receives a force from the piston in a direction across the piston axis. The restrictor comprises a projection (62) on either the edge or the housing wall, which engages with a recess (61) on the other of the two parts.