Drive for a door or a window, comprising a housing, an output shaft mounted rotatably on the housing and having a cam disc, an electric motor with a transmission for driving the output shaft from a closed position in an opening direction, in order to open the door or the window, a roller rolling over the rotating cam disc during operation, a pivot lever, which is hinged pivotably on the housing about a pivot axis, the roller being arranged rotatably on the pivot lever, and an energy storage unit for driving the output shaft from an open position in a closing direction, in order to close the door or the window, the energy storage unit having an energy store, with a longitudinal axis, and a movable first abutment facing the roller, and also a second abutment, which faces away from the roller, on which abutments the energy store is supported, the roller acting in a force-transmitting manner between the cam disc and the movable first abutment of the energy storage unit, the cam disc and the energy storage unit being arranged on mutually opposite sides with respect to the pivot lever, and the movable first abutment of the energy storage unit being coupled rotatably and non-displaceably to the pivot lever at a coupling point and thus being guided on a circular path by the pivot lever, characterized in that, in the closed position, the central axis of the output shaft is arranged in alignment with the longitudinal axis of the energy store, or in that, in the closed position, the central axis of the output shaft is arranged offset with respect to the longitudinal axis of the energy store by at most the diameter of the roller or output shaft. a housing, an output shaft mounted rotatably on the housing and having a cam disc, an electric motor with a transmission for driving the output shaft from a closed position in an opening direction, in order to open the door or the window, a roller rolling over the rotating cam disc during operation, a pivot lever, which is hinged pivotably on the housing about a pivot axis, the roller being arranged rotatably on the pivot lever, and an energy storage unit for driving the output shaft from an open position in a closing direction, in order to close the door or the window, the energy storage unit having an energy store, with a longitudinal axis, and a movable first abutment facing the roller, and also a second abutment, which faces away from the roller, on which abutments the energy store is supported, the roller acting in a force-transmitting manner between the cam disc and the movable first abutment of the energy storage unit, the cam disc and the energy storage unit being arranged on mutually opposite sides with respect to the pivot lever, and the movable first abutment of the energy storage unit being coupled rotatably and non-displaceably to the pivot lever at a coupling point and thus being guided on a circular path by the pivot lever, characterized in that, in the closed position, the central axis of the output shaft is arranged in alignment with the longitudinal axis of the energy store, or in that, in the closed position, the central axis of the output shaft is arranged offset with respect to the longitudinal axis of the energy store by at most the diameter of the roller or output shaft.