A detachable lamp socket includes a top cover, a mounting plate secured on the top cover, a housing detachably mounted on the mounting plate, a base secured in the housing, a circuit board mounted in the housing and supported by the base, and a locking rod movably mounted in the base and having a first end extended through the circuit board and the housing and retractably extended into the mounting plate to lock the housing onto the mounting plate. Thus, the housing can be rotated relative to the mounting plate to detach the housing from the mounting plate for maintenance of the lamp socket.