If the ceiling allows it, you can also attach the cabinets to it. You must ensure that the carcass is not screwed directly to the top of the cabinet. The cabinet needs to have a gap because the ceiling will not be perfectly even. You could place two decorative strips between the cabinet and the ceiling. Additionally, something must be placed underneath so that the cabinet is level. The load is carried by the side walls of the cabinet. To enable this, four metal brackets must be screwed into the upper corners of a cabinet. The cabinet can then be screwed to the room ceiling through the brackets and the cabinet top. Since the holes in the ceiling cannot be drilled with millimeter precision, the holes through the brackets and the cabinet top should be large enough to allow the cabinet to be properly aligned. It is, of course, necessary to use a locking device for the screw, as supplied with the cabinets. When choosing the screws, make sure that the screw head is capable of bearing the load. It would also be possible to screw a threaded bolt into the anchor and then secure the cabinet with nuts. I would favor this option.