The invention relates to a shipborne method for preparing an organic fertilizer and coproducing an antibacterial building material by using sludge. The method comprises the following steps: exploring,designing and sucking sludge, carrying out primary solid-liquid separation to lower the water content to 80% or below, stirring, carrying out air floatation to separate heavy metals, organic mattersand mud sand, sucking the organic matters from the upper layer of a separation tank, and carrying out fermentation compounding to obtain the organic fertilizer. The silt sediment is dehydrated for thesecond time to enable the water content to reach 20%-50%, the special cementing material is added according to 5%-30% of the silt dry basis, and the building block, the water permeable brick and thebuilding antibacterial building material with the antibacterial function can be obtained through stirring and forming. According to the technical method, land acquisition is not needed, secondary pollution is avoided, the method is environmentally friendly, the developed antibacterial veneer board is particularly suitable for public places of high-risk groups and sterile wards, food factories, pharmaceutical factories and high-end residences of the public places in a wide range, and good news is brought to health of people.