The device (1) has a transporting unit (2), which transports the containers (10) along a predetermined transport path. The sterilization units (20) are attached at the transport unit. The each sterilization unit has a moving unit for moving the containers relative to a rod-like charge carrier lining unit in a longitudinal direction of the containers. The movements of the containers are independently controlled relative to the arranged charge carrier lining unit by motion profiles. A detection unit is provided with a clean room (40), where the clean room is transported in plastic containers. An independent claim is included for a method for sterilizing containers.