The invention provides a lighting device which comprises a lighting unit and a switch part, an installation part and an installation box of the lighting unit. The switch part is arranged in the installation box, the switch part is provided with a first fixed end, a second fixed end, an elastic piece, a connecting piece and a fixed position; the fixed position is arranged on one sides of the first fixed end and the second fixed end, the connecting piece is arranged on one sides of the first fixed end and the second fixed end, one end of the elastic piece is fixedly arranged on the fixed position, and the other end of the elastic piece is fixedly arranged on the connecting piece; the installation part comprises a pair of magnetic parts which comprise a first magnetic part and a second magnetic part, wherein the first magnetic part is arranged outside of the lighting device, and the second magnetic part is fixedly arranged on the connecting piece. According to the lighting device, indoor lighting and wardrobe lighting are achieved, the lighting device is also suitable for lighting of other dark positions with door instructures, the structure design of a magnetic control switch is achieved, the connecting control structure is simplified, the control of the magnetic control switch is easy and convenient, light is provided as long as a door is opened, wait and grope are not needed, and the experience of a user is enhanced greatly.