Alekseyev was born in Vyazma, in the Smolensk Governorate of the Russian Empire (present-day Smolensk Oblast, Russia). His father, Vasili Alekseyev, was an army captain in the 64th Kazan Regiment from a modest background. In 1873 Alekseyev entered as a volunteer in the 2nd Grenadiers Regiment in Rostov. He graduated from the Moscow Infantry School in 1876 and was commissioned an ensign in the same 64th Kazan Regiment. He served as an orderly to General Mikhail Skobelev during the Russo-Turkish War (1877–1878), and was wounded in combat near Pleven, Bulgaria. He was promoted to lieutenant in January 1881, and captain in May 1883.
Completing his studies at the Nicholas General Staff Academy in 1890 with the rank of lieutenant colonel, he was posted as a senior adjutant in the headquarters of the 1st Army Corps in the St. Petersburg Military District. He served in this capacity and as a professor at the Academy's Department of Military History from 1898 to 1904. In March 1904, he was promoted to the rank of major general.
With the outbreak of the Russo-Japanese War, in October 1904 Alekseyev was appointed Quartermaster General of the Russian 3rd Manchurian Army. During the war he was awarded a gold sword, the Order of St. Stanislav, and the Order of St. Anne.
After the war, he became first senior quartermaster of the General Staff’s main directorate, while maintaining his position as a professor at the General Staff Academy. In 1908 he was made Chief of Staff of the Kiev military district and promoted to lieutenant general. In 1912 Alekseyev was given command of the 13th Army Corps.
The beginning of World War I in August 1914 saw Alekseyev appointed Chief of Staff of the Southwestern Front (which held the Third, Fourth, Fifth, and Eighth Armies), where he planned the Russian offensive into Galicia with the rank of General-of-Infantry. He was subsequently awarded the Order of St. George (4th class). In March 1915 Alekseyev became the overall commander of the Russian Northwestern Front.