CO2 and H2S contents of biogas is to be removed first and then Methane can be liquefied at -161oC and conveniently stored in cylinders. The removal of CO2 from biogas would be difficult and expensive when compared to H2S removal. Compressed Natural Gas (CNG) is made by compressing natural gas to less than 1% of the volume it occupies at standard atmospheric pressure.
You could use a liquid ring compressor for moderate pressures, in which the ring also scrubs the bio-gas. Depending on your process methane and ammonia might be present. If it is H2S there are commercial systems that make sulfur bricks by partial burning of H2S to make SO2 for the Klaus process. Beware of toxic, corrosive, and flammable properties.