We provide a full realization of the electromagnetic duality at the boundary by extending the phase space of Maxwell's theory through the introduction of edge modes and their conjugate momenta. We show how such extension, which follows from a boundary action, is necessary in order to have well defined canonical generators of the boundary magnetic symmetries. In this way, both electric and magnetic soft modes are encoded in a boundary gauge field and its conjugate dual. This implementation of the electromagnetic duality has striking consequences. In particular, we show first how the electric charge quantization follows straightforwardly from the topological properties of the $U(1)$-bundle of the boundary dual potential. Moreover, having a well defined canonical action of the electric and magnetic symmetry generators on the phase space, we can compute their algebra and reveal the presence of a central charge between them. We conclude with possible implications of these results in the quantum theory.