We present a measurement of the first-order azimuthal anisotropy v1 of deuterons from Au+Au collisions at sNN=7.7, 11.5, 14.5, 19.6, 27, and 39 GeV recorded with the STAR experiment at the Relativistic Heavy Ion Collider (RHIC). The energy dependence of the v1(y) slope, dv1/dy|y=0, for deuterons, where y is the rapidity, is extracted for semicentral collisions (10%-40% centrality) and compared with that of protons. While the v1(y) slopes of protons are generally negative for sNN>10GeV, those for deuterons are consistent with zero, a strong enhancement of the v1(y) slope of deuterons is seen at the lowest collision energy (the largest baryon density) at sNN=7.7GeV. In addition, we report the transverse momentum dependence of v1 for protons and deuterons. The experimental results are compared with transport and coalescence models.