The complex behaviours of schools of fish and swarms of bacteria can be emulated in soft-matter systems that assemble into flocks and active nematics, respectively. These artificial structures emerge far from thermodynamic equilibrium through the process of dissipative self-organization, in which many-body interactions coordinate energy dissipation. The development of such active matter has deepened our understanding of living systems. Yet, the application of dissipative self-organization has been restricted to soft-matter systems, whose elements organize through their respective motions. Here, we demonstrate dissipative self-organization in solid-state photonics. Our structure consists of a random array of Fabry–Pérot resonators that are externally driven and interact coherently through thermo-optical feedback. At sufficient optical driving power, the system undergoes a phase transition into a robustly organized non-equilibrium state that actively partitions energy dissipation, while displaying resiliency to perturbations and collective memory. Self-organizing photonics opens possibilities for developing scalable architectures and life-like networks for brain-inspired computation.