A diaphragm compressor having a compressor head comprising a hydraulic fluid plate having a fluid plate contact plane and a process fluid plate having a process plate contact plane , the hydraulic fluid plate and the process fluid plate forms a compression chamber when contact between the fluid plate contact plane and the process plate contact plane is established, the compression chamber is divided in an upper chamber and a lower chamber by a multi-layered diaphragm , wherein a controller is configured for controlling an alternating movement of the multi-layered diaphragm towards the upper and the lower chambers respectively, wherein a process fluid plate seal is positioned in a process fluid seal groove provided in the process plate contact plane , the process fluid plate seal forms a process fluid seal between an upper side of the multi-layered diaphragm and the process plate contact plane wherein said multi-layered diaphragm comprises a process diaphragm (8-1), a hydraulic diaphragm (8-3) and a leak detection diaphragm (8-2), wherein the process fluid plate comprises a process fluid leak groove system fluidly connected to a process fluid plate leakage passage provided in the process fluid plate , and wherein said diaphragm compressor is characterized in that said leak detection diaphragm (8-2) comprises one or more process side diaphragm grooves provided in the side of said leak detection diaphragm (8-2) facing said process fluid diagram (8-1) and in that said process fluid diaphragm (8-1) comprises one or more holes wherein said one or more process side diaphragm grooves are configured for guiding a leak of process fluid to said process fluid leak groove system via said one or more holes while at the same time separating said leak of process fluid from a potential leak of hydraulic fluid from said hydraulic diaphragm (8-3). wherein a controller is configured for controlling an alternating movement of the multi-layered diaphragm towards the upper and the lower chambers respectively, wherein a process fluid plate seal is positioned in a process fluid seal groove provided in the process plate contact plane , the process fluid plate seal forms a process fluid seal between an upper side of the multi-layered diaphragm and the process plate contact plane wherein said multi-layered diaphragm comprises a process diaphragm (8-1), a hydraulic diaphragm (8-3) and a leak detection diaphragm (8-2), wherein the process fluid plate comprises a process fluid leak groove system fluidly connected to a process fluid plate leakage passage provided in the process fluid plate , and wherein said diaphragm compressor is characterized in that said leak detection diaphragm (8-2) comprises one or more process side diaphragm grooves provided in the side of said leak detection diaphragm (8-2) facing said process fluid diagram (8-1) and in that said process fluid diaphragm (8-1) comprises one or more holes wherein said one or more process side diaphragm grooves are configured for guiding a leak of process fluid to said process fluid leak groove system via said one or more holes while at the same time separating said leak of process fluid from a potential leak of hydraulic fluid from said hydraulic diaphragm (8-3). <EOS>