A device for liquefaction of a gas, the device comprising: a thermally insulated region in which the gas is liquefied and collected, a gas supply system comprising a first section outside the thermally insulated region and a second section within the thermally insulated region, wherein the first section provides a purified stream of gas to a gas supply line in the second section, a cryogenic refrigerator comprising a warm section (100,108,110,112) outside the thermally insulated region and a cold section (114,120,122) inside the thermally insulated region, wherein the cold section is thermally coupled to the second section of the gas supply system to cool the purified stream of gas, a dispensing line comprising an input end within the thermally insulated region and an output end outside the thermally insulated region, wherein: the first section of the gas supply system comprises a compressor to compress the gas so that the purified stream of gas has a high pressure above atmospheric pressure; the cold section of the cryogenic refrigerator has a minimum temperature above a boiling point of the gas at atmospheric pressure and below a boiling point of the gas at the high pressure, the second section of the gas supply system comprises a flow restrictor where the pressure drops from the high pressure to atmospheric pressure and a portion of the purified stream of gas evaporates, cooling a fraction of the purified stream of gas to the boiling point of the gas at atmospheric pressure; and wherein the purified stream of gas consists of nitrogen or oxygen; characterized in that the cryogenic refrigerator uses a multi-component, mixed refrigerant; the cryogenic refrigerator is a Kleemenko-cycle cryogenic refrigerator; and the first section of the gas supply system comprises a pressure swing absorber, a membrane separator, a hygrometer connected to the membrane separator, and a valve connected to the hygrometer to control the flow of gas to the second section of the gas supply system in dependence upon a level of gas purity detected by the hygrometer. a thermally insulated region in which the gas is liquefied and collected, a gas supply system comprising a first section outside the thermally insulated region and a second section within the thermally insulated region, wherein the first section provides a purified stream of gas to a gas supply line in the second section, a cryogenic refrigerator comprising a warm section (100,108,110,112) outside the thermally insulated region and a cold section (114,120,122) inside the thermally insulated region, wherein the cold section is thermally coupled to the second section of the gas supply system to cool the purified stream of gas, a dispensing line comprising an input end within the thermally insulated region and an output end outside the thermally insulated region, the first section of the gas supply system comprises a compressor to compress the gas so that the purified stream of gas has a high pressure above atmospheric pressure; the cold section of the cryogenic refrigerator has a minimum temperature above a boiling point of the gas at atmospheric pressure and below a boiling point of the gas at the high pressure, the second section of the gas supply system comprises a flow restrictor where the pressure drops from the high pressure to atmospheric pressure and a portion of the purified stream of gas evaporates, cooling a fraction of the purified stream of gas to the boiling point of the gas at atmospheric pressure; and wherein the purified stream of gas consists of nitrogen or oxygen; characterized in that the cryogenic refrigerator uses a multi-component, mixed refrigerant; the cryogenic refrigerator is a Kleemenko-cycle cryogenic refrigerator; and the first section of the gas supply system comprises a pressure swing absorber, a membrane separator, a hygrometer connected to the membrane separator, and a valve connected to the hygrometer to control the flow of gas to the second section of the gas supply system in dependence upon a level of gas purity detected by the hygrometer.