The present invention discloses a preparation method for electrodeposition of a hydroxyapatite coating on the surface of titanium or a titanium alloy. The method comprises: adopting a pretreated titanium substrate or a pretreated titanium alloy substrate as a cathode, adopting a platinum-plated titanium mesh as an anode, heating an electroplating solution to a constant temperature of 40-80 DEG C, and adopting a constant current manner or a constant potential manner under a magnetic stirring condition to carry out electrodeposition, wherein a current density is 1.0-50.0 mA.cm<-2>, a deposition potential is 1.0-10.0 V, the electroplating solution comprises 20.2-80.0 mmol.L<-1> of Ca<2+> and 10.0-50.0 mmol.L<-1> of H2PO4<->, a Ca/P molar ratio is 1.6-2.0, a supporting electrolyte concentration is 0.1-1.0 mol.L<-1>, and the pH value is 4.2-5.0. According to the present invention, the hydroxyapatite coating prepared through electrodeposition by using the constant current manner or the constant potential manner has characteristics of fine crystal, smooth surface, strong bonding force with the substrate, good biological activity and mechanical property. The preparation method for the titanium base hydroxyapatite composite material has characteristics of mild reaction condition, avoidance of influence on material biological activity by a high temperature treatment, simple process, and low equipment investment, wherein a series of problems caused by expensive equipment and complex operation of the existing method are overcome with the preparation method.