Bacterial infections and the emergence of drug-resistant after the misuse of antibiotics are threats to human health worldwide. Photothermal nanomaterials incorporating metallic antibacterial agents offer a promising solution. Herein, an antibacterial nanocomposite (Ag@SF@PDA) comprising silver nanoparticles (AgNPs) with silk fibroin/polydopamine nanospheres (SF@PDA) was designed for efficient antibacterial application. Specifically, AgNPs were reduced in situ by polydopamine and encapsulated in the polydopamine outer layer. The Ag@SF@PDA, with a diameter of about 144.7 nm, had a spherical shape and a rough surface. Under 808 nm, 1.5 W/cm2 NIR near-infrared (NIR) irradiation, Ag@SF@PDA demonstrated excellent photothermal performance and stability, reaching a maximum temperature of 56.8 °C after 12 min. Their photothermal performance was improved as the concentration increased. The viability results of L929 fibroblasts in vitro demonstrated that Ag@SF@PDA had good biocompatibility. Even when the concentration was increased to 0.5 mg/mL, the cells still maintained their viability. Of note, Ag@SF@PDA exhibited remarkably high antibacterial efficacies against both Staphylococcus aureaus and Escherichia coli after NIR irradiation. Their antibacterial efficacies were above 99.9% under NIR irradiation and comparable to those of ampicillin. These photothermal nanospheres have a great potential in efficient antibacterial application.