The muon detector of the LHCb experiment consists of five tracking stations placed along the beam axis. The first station, M1, is placed in front of the calorimeters; the other four are placed after, interspersed with iron shields. The main purpose of the detector is to provide muon identification for the trigger and offline analysis. The lower rate parts of the detector will be equipped with two layers of Resistive Plate Chambers while Multi Wire Proportional Chambers are used for the higher rate regions. We discuss the requirements and the layout of the detector and present the results obtained in tests of various chamber prototypes.