This paper presents the design of a digital twin for a 6U CubeSat electrical power system, including the solar arrays, solar array regulators, battery, power distribution unit, and load subsystems. The digital twin is validated by comparing its real-time outputs with those of the physical system. Experimental tests confirm its feasibility, showing that the digital twin’s real-time outputs closely match those of the physical system. Additionally, the digital twin can be used for control-hardware-in-the-loop and power-hardware-in-the-loop tests, allowing the real-time integration of simulated subsystems with hardware. This capability facilitates testing of new subsystems and optimization during the project’s development phases. Additionally, to demonstrate the advanced capabilities of this model, the digital twin is used to simulate the CubeSat electrical power system behavior in real time throughout a complete orbital cycle in low Earth orbit conditions. This simulation provides valuable insights into the CubeSat operation by capturing the transient and steady-state responses of the EPS components under real orbital conditions. The results obtained indicate that the digital twin significantly enhances the testing and optimization process of new subsystems during the development phases of the project. Moreover, the capabilities of the digital twin can be further augmented by incorporating real-time telemetry data from the CubeSat, resulting in a highly accurate replication of the satellite’s in-orbit behavior. This approach is crucial for identifying and diagnosing failures or malfunctions in the electrical power system, ensuring the robust and reliable operation of the CubeSat.