We propose an all-optical phase-shifting method using Yb-doped optical fibers and demonstrate its potential in on-axis digital holography microscopy (DHM) system. The Yb-doped optical fiber induces a phase change under optical pumping conditions. The induced phase shift shows a good linear response to applied pumping currents, and N-step phase-shifting up to 2p can be properly performed. Four-, six-, and eight-step phase-shifting methods are performed, and the phase retrievals from their phase-shifted interferograms are achieved using an interframe correlation matrix method. An 8-step phase shifting-based reconstruction, which is effective for background noise reduction, is used for 3D imaging of an indium tin oxide (ITO) thin film and an organic light-emitting diode (OLED) thin film. The reconstructed surface profile was in agreement with the step structure of the samples. The proposed all-optical phase-shifting method is expected to be applied to various optical imaging systems using fiber-based phase-shifting interferometers.