He reported to the Rangers' depot at Sheerness on 15 January 1834, and was stationed with them in England and Ireland until 1836, when the regiment was ordered to the Mediterranean. He reached Malta with the regiment on 1 January 1837. The regiment was several years in the Mediterranean, and he took a tour of Greece with several brother-officers in the summer of 1841. He purchased a majority after Ormsby Phibbs purchased the lieutenant-colonelcy of the regiment, on 31 December 1841. In 1847, the regiment was ordered to the West Indies. Shirley was promoted to lieutenant-colonel on 18 January 1848 and took command of the regiment, after Phibbs died of yellow fever in Barbados. The regiment was sent to Halifax in 1850, and returned to England in 1851. Under Shirley's command, the Connaught Rangers showed remarkably good discipline, largely free of crime and drunkenness. On 2 April 1854, the Connaught Rangers, then quartered in Preston, Lancashire, were ordered to march for Liverpool and take ship for the theatre of war on the Black Sea. At the Battle of the Alma on 20 September, the Connaught Rangers were engaged in the left brigade of the Light Division. Early in the action a Minié ball struck Shirley and became embedded in his prayer book, doing him no harm. As the regiment advanced to support William Norcott with some of the Rifle Brigade and crossed the River Alma, Shirley was ordered by Sir George Buller to have the regiment form square to repel a cavalry attack that never materialised. This allowed part of the 1st Division to overtake them so that the Rangers saw little further action at the battle. Shirley was brevetted a colonel on 2 November 1854. He commanded the Rangers at the Battle of Inkerman on 5 November. During the Siege of Sevastopol, Shirley, as general officer commanding the trenches, prepared the attack of 7 June 1855 upon the "Quarries", a line of rifle pits lying before the Great Redan. The troops detailed for the purpose from the 2nd Brigade, Light Division, surprised the Russians that evening, successfully took the Quarries, and held them against Russian counterattacks throughout the night and the next morning. Shirley was mentioned in dispatches by Lord Raglan for his conduct of the attack. He was also general officer of the trenches during the unsuccessful attack on the Redan on 18 June, which he did not command. On 5 July 1855, he was rewarded with a grant of £100 p.a. and appointed a Companion of the Order of the Bath, and on 30 July 1855, was given the local rank of brigadier general in Turkey.