In this paper, the optical conductivity of a two-dimensional Lieb lattice that is a line-centered square lattice is investigated in the presence of magnetic field and spin–orbit coupling. Specially, we address the frequency dependence of optical conductivity due to spin–orbit interaction. Using Green’s function approach, the behavior of optical conductivity has been obtained in the context of Kane–Mele model Hamiltonian. In the presence of magnetic field at low spin–orbit coupling strength, optical conductivity includes only Drude weight at zero frequency limit while interband transitions of electrons have no contribution to optical conductivity for each gap parameter below normalized value 0.6. However the increase of spin–orbit coupling strength causes to appear finite frequency peak in optical conductivity. Moreover our results show that optical conductivity increases with temperature for each value of spin–orbit coupling and magnetic field. Also we have studied the effects of magnetic field, electron doping and spin–orbit coupling on temperature dependence of optical conductivity of Lieb monolayer.