Bacterial infection of the implanting materials is one of the greatest challenges in bone tissue engineering. In this study, porous forsterite scaffolds with antibacterial activity have been fabricated by combining 3D printing and polymer-derived ceramics (PDCs) strategy, which effectively avoided the generation of MgSiO3 and MgO impurities. Forsterite scaffolds sintered in an argon atmosphere can generate free carbon in the scaffolds, which exhibited excellent photothermal effect and could inhibit the growth of Staphylococcus aureus (S. aureus) and Escherichia coli (E. coli) in vitro. In addition, forsterite scaffolds have uniform macroporous structure, high compressive strength (>30 MPa) and low degradation rate. Hence, forsterite scaffolds fabricated by combining 3D printing and PDCs strategy would be a promising candidate for bone tissue engineering.