The epitaxy of PbTe semiconductor materials on Si substrates can be combined with existing microelectronic technology to produce infrared focal plane arrays. In this work, we used the reactive ion etching(RIE) method to fabricate Si holes. Then, we used the electrochemical epitaxial deposition method to deposit PbTe material on the Si holes to prepare the PbTe/Si heterojunction photodetectors. The detectors have low dark current, and the fastest response speed can reach 0.16 s. We can deposit lead telluride through a simple, template-free electrochemical method. By precisely controlling conditions such as precursor concentration, reaction time, and deposition potential, the morphology of lead telluride can be transformed from pyramidshaped to a nanowire. This facile etching route could also be extended to the preparation of varying morphologies of functional inorganic materials.