Optogenetics has emerged as a promising means to achieve gene expression control in bioprocess engineering, but current systems cannot respond to fluctuations in growth conditions. Here the authors overcome this limitation and develop an automated optogenetic feedback control system for precise and robust control of protein production in E. coli.