The present invention provides a method of producing hydrogen from a waste material, comprising steps of fermenting 100 a fermentation mixture comprising the waste material in a reactor 1 with a headspace 1a under anaerobic conditions, removing 200 hydrogen from a gas from the headspace 1a during fermentation to produce a hydrogen gas and a remainder gas and recirculating 300 at least a portion of the remainder gas back to the headspace 1a. An apparatus for producing hydrogen and recirculating at least a portion of the remainder gas to the headspace 1a is also provided.