A magnetic fastening device for releasably fastening a first unit and a second unit to each other, the magnetic fastening device comprising at least one pair of magnets, wherein one of the units is provided with at least one protrusion, while the other of the units is provided with at least one recess for receiving the at least one protrusion, and wherein a first magnet and a second magnet of each pair are displaced relative to each other by a displacement distance in a displacement direction such that, in a state in which the units abut against each other, a component of the attractive force maintains the at least one protrusion in the at least one recess.