Biofilms on public devices and medical instruments are harmful. Hence, it is of great importance to fabricate antibacterial surfaces. In this work, we target the preparation of an antibacterial surface excited by near-infrared light via the coating of rare earth nanoparticles (RE NPs) on a titanium surface. The upconverted luminescence is absorbed by gold nanoparticles (Au NPs, absorber) to produce hot electrons and reactive oxygen species to eliminate the biofilms. The key parameters in tuning the upconversion effect to eliminate the biofilms are systematically investigated, which include the ratios of the sensitizer, activator, and matrix in the RE NPs, or the absorber Au NPs. The regulated RE NPs exhibit an upconversion quantum yield of 3.5%. Under illumination, photogenerated electrons flow through the surface to bacteria, such as E. coli, which disrupt the breath chain and eventually lead to the death of bacteria. The mild increase of the local temperature has an impact on the elimination of biofilms on the surface to a certain degree as well. Such a configuration on the surface of titanium exhibits a high reproducibility on the removal of biofilms and is functional after the penetration of light using soft tissue. This work thus provides a novel direction in the application of upconversion materials to be used in the fabrication of antibacterial surfaces.