An anaerobic digester, comprising: a first input reactor into which livestock wastewater or food waste (hereinafter, 'inflow') is introduced; a second input reactor into which the inflow passing through the first input reactor is introduced; first, second, third, and fourth regions of an anaerobic digestion reactor designed for the inflow passing through the second input reactor to perform methane fermentation in a first-in and first-out order to produce and transfer biogas simultaneously into the next anaerobic digestion region; a diffusing gas supply tube and a diffuser giving fluidity to the inflow of the first, second, third, and fourth regions; an inlet pipe in a lower layer portion of the fourth region of the anaerobic digestion reactor, into which sludge liquid is drawn in from the lower layer portion; an inlet pipe in an upper layer portion of the fourth region of the anaerobic digestion reactor, into which activated liquid is drawn in from the upper layer portion; a biogas capturing device which is connected to a gas layer in the fourth region of the anaerobic digestion reactor; a first heat exchange tube provided inside the first input reactor to allow the sludge liquid drawn in from the inlet pipe in the lower layer portion to perform heat exchange with a new inflow; first, second, third, and fourth regions of a subsequent treatment reactor provided on the upper layer of the anaerobic digestion reactor, to allow the sludge liquid whose heat exchange is completed to be introduced in a first-in and first-out order, and to treat gas odor components generated from the sludge liquid; and a liquid-composting reactor in which an emitted sludge whose odor components have been removed is stored. a first input reactor into which livestock wastewater or food waste (hereinafter, 'inflow') is introduced; a second input reactor into which the inflow passing through the first input reactor is introduced; first, second, third, and fourth regions of an anaerobic digestion reactor designed for the inflow passing through the second input reactor to perform methane fermentation in a first-in and first-out order to produce and transfer biogas simultaneously into the next anaerobic digestion region; a diffusing gas supply tube and a diffuser giving fluidity to the inflow of the first, second, third, and fourth regions; an inlet pipe in a lower layer portion of the fourth region of the anaerobic digestion reactor, into which sludge liquid is drawn in from the lower layer portion; an inlet pipe in an upper layer portion of the fourth region of the anaerobic digestion reactor, into which activated liquid is drawn in from the upper layer portion; a biogas capturing device which is connected to a gas layer in the fourth region of the anaerobic digestion reactor; a first heat exchange tube provided inside the first input reactor to allow the sludge liquid drawn in from the inlet pipe in the lower layer portion to perform heat exchange with a new inflow; first, second, third, and fourth regions of a subsequent treatment reactor provided on the upper layer of the anaerobic digestion reactor, to allow the sludge liquid whose heat exchange is completed to be introduced in a first-in and first-out order, and to treat gas odor components generated from the sludge liquid; and a liquid-composting reactor in which an emitted sludge whose odor components have been removed is stored.