A cleaning device for a beverage preparation machine, the device comprising a first chamber for receiving a solid cleaning agent, a liquid line system with a water line connectable to a water connection for supplying water and a discharge line, which is connected to the first chamber and is connectable to the beverage preparation machine, a piston unit comprising a first piston, a second piston and a connecting line which is arranged between the first piston and the second piston and is connecting the first piston with the second piston, wherein the first piston is insertable into the first chamber and water can be introduced into the first chamber via the connecting line when the first piston is inserted in the first chamber.