Ideally, the solenoid valve must be mounted in a horizontal pipe run with the solenoid vertically on top. This ensures that the armature tube points upwards, thus reducing the risk of any sediments in the media falling into the tube and restricting the armature movement.