A compact solid-state laser based on a Nd:YAG (1 at. %) ceramic active media in the Q-switched mode was studied. Ceramic YAG elements with different concentrations (0.1 to 1 at.%) of Cr4+ doping were used as a Q-switches, 50 to 500 ns pulses were registered with the high energy single pulse. Transparent ceramic obtained by thermosetting sintering. A laser scheme is proposed with a pulse duration and energy setting that contains a composite element for combining the properties of the studied samples of transparent ceramics in one volume. This scheme allows you to implement a compact laser to clean the surface of various materials (glass, concrete, plastic, steel, etc.) from contamination.