A combination of calcination and hydrothermal processing was used to prepare a g-C3N4/UiO-66-NH2/CdS photocatalyst, and the degradation of tetracycline (TC) over this material was assessed. The photocatalytic performance of this nanocomposite was approximately 4.4 and 2.3 times those of CdS and g-C3N4, respectively, and was found to be affected by the CdS loading amount, the pH of the reaction solution and the initial TC concentration. This catalyst also exhibited stable performance over four consecutive reaction cycles. The highly enhanced photoactivity of the g-C3N4/UiO-66-NH2/CdS is attributed to the introduction of CdS, which widens the range over which the material absorbs visible light and inhibits the recombination of electron–hole pairs. The results of this study suggest further applications for this material in the treatment of contaminated wastewater powered by solar energy.