A quantum computer has the potential to efficiently solve problems that are intractable for classical computers. However, constructing a large-scale quantum processor is challenging because of the errors and noise that are inherent in real-world quantum systems. One approach to addressing this challenge is to utilize modularity—a strategy used frequently in nature and engineering to build complex systems robustly. Such an approach manages complexity and uncertainty by assembling small, specialized components into a larger architecture. These considerations have motivated the development of a quantum modular architecture, in which separate quantum systems are connected into a quantum network via communication channels1,2. In this architecture, an essential tool for universal quantum computation is the teleportation of an entangling quantum gate3-5, but such teleportation has hitherto not been realized as a deterministic operation. Here we experimentally demonstrate the teleportation of a controlled-NOT (CNOT) gate, which we make deterministic by using real-time adaptive control. In addition, we take a crucial step towards implementing robust, error-correctable modules by enacting the gate between two logical qubits, encoding quantum information redundantly in the states of superconducting cavities6. By using such an error-correctable encoding, our teleported gate achieves a process fidelity of 79 per cent. Teleported gates have implications for fault-tolerant quantum computation3, and when realized within a network can have broad applications in quantum communication, metrology and simulations1,2,7. Our results illustrate a compelling approach for implementing multi-qubit operations on logical qubits and, if integrated with quantum error-correction protocols, indicate a promising path towards fault-tolerant quantum computation using a modular architecture.