The hard X-ray nanoprobe beamline is the first beamline to take advantage of the full coherent beam to attain the nanoscale focusing at the Shanghai Synchrotron Radiation Facility (SSRF). Here we introduce the beamline and specially go over the features of the multilayer Kirkpatrick-Baez focusing system and its supporting phase compensator system. The performance and stability of the phase compensator are also put to the test. By using the speckle scanning metrology, the wavefront of a focused beam was characterized and intensity distribution near the focus was reconstructed. The focusing performance was greatly enhanced by two phase compensations based on a global optimization technique, and a two-dimensional focal spot of 26 nm × 17 nm was achieved and maintained with good stability.