The day after war was declared, Cockerell joined up as a despatch rider in the Royal Flying Corps. In April 1915 he became an air mechanic 2nd class and later that year was promoted to air mechanic 1st class. Cockerell was granted his Royal Aero Club Pilot's Certificate No. 3271 on 21 July 1916 and became a sergeant pilot with 24 Squadron. He used an Airco DH.2 on 14 September 1916 to share a victory with Arthur Gerald Knight, when they set a Fokker D.II aflame. He scored again on 30 September, again setting his enemy on fire. Cockerell was wounded in the hip on 10 October. He was commissioned a second lieutenant on 27 October 1916. He then took a break until 4 February 1917, when he shared in the destruction of a reconnaissance plane. Two days later, he was the sole destroyer of another reconnaissance plane. On 2 April 1917, he destroyed an Albatros D.III for his fifth victory. He upgraded to an Airco DH.5 on 25 May for his sixth kill, when he destroyed another Albatros D.III. Cockerell was then withdrawn to England to serve in Home Defence squadrons at Hornchurch. He was appointed a flight commander on 1 September 1917, with the temporary rank of captain. He returned to France in July 1918 with 151 Squadron. On 4 August, while flying a Sopwith Camel in the squadron's night intruder role, he bombed the German aerodrome at Guizancourt. A Gotha bomber subsequently attempted a recovery at the field, and Cockerell destroyed it for his seventh consecutive victory. Cockerell was appointed Chevalier of the Order of the Crown in August 1917 and was awarded the Croix de guerre in March 1918, both by Belgium. Although he was later regraded as a substantive flight lieutenant in line with the RAF's new rank system, he continued to be generally known as "Captain Cockerell".
Post-World War I
On 21 August 1919, Cockerell flew a Vickers Vimy from London to Amsterdam loaded with copies of The Times, which were then sold for the benefit of local charities. On 24 June 1920, Cockerell took off from Brooklands in a Vickers Vimy on a pioneering flight to South Africa in an attempt to test the air route from Cairo to the Cape of Good Hope. He was accompanied by fellow pilot Captain Frank Broome DFC, mechanic Sergeant-Major James Wyatt MSM, rigger Claude Corby, and passenger Peter Chalmers Mitchell, an eminent zoologist and correspondent for The Times, which sponsored the flight. That evening they arrived at RAF Manston in Kent. The following day they crossed the English Channel and arrived at Lyon. They reached Istres on 26 January, Rome on 27 January, Malta on 29 January, Tripoli on 31 January, Benghazi on 1 February, and Heliopolis near Cairo on 3 February. On 6 February, they set out for the main flight to South Africa and reached Aswan. On 8 February, after two forced landings caused by leaking cylinder water jackets, they reached Khartoum. After repairs, they left Khartoum on 10 February and reached El Jebelein, 208 miles to the south. Following further repairs, they left later the same day, but were forced to land in a dry swamp near Renk. The following day they returned to Jebelein for further repairs. On 14 February, they set off again and reached Mongalla, in the far south of Sudan the following day, after spending the night on the banks of the Nile. They remained in Mongalla making repairs until 20 February, when they took off again and reached Nimule, again with engine trouble. They began again on 22 February and reached Uganda in Uganda. On 24 February they left again and reached Kisumu in Kenya. They reached Tabora in Tanganyika Territory on 26 February, but crashed on take-off the following day, writing off the machine and ending the flight. Cockerell and Corby were slightly injured. Cockerell and Broome did eventually reach Cape Town, although not by air, and were welcomed by, among others, Pierre van Ryneveld and Quintin Brand, who had made the flight successfully by a slightly different route and were the only one of five crews attempting the journey to successfully complete it. On 12 July 1920, Cockerell and Broome were awarded the Air Force Cross and Wyatt and Corby the Air Force Medal in recognition of the flight. On 17 August 1920, Cockerell was best man at Broome's wedding. He married Lorna Lockyer in 1921. On 4-6 March 1921, Cockerell carried out trials of the prototype Vickers Valentiaflying boat over the Solent for the Air Ministry. On 17 March 1921, he landed a flying boat on the River Thames near the Palace of Westminster. On 15 March 1922, he ditched a flying boat in the Channel four miles off Hastings while making a test flight from Portsmouth to Sheerness. He and his two companions, Broome and Wyatt, were rescued from the water. On 13 April 1922 he was the pilot for the maiden flight of the Vickers Viking which later that day crashed at Brooklands while being flown by Sir Ross Macpherson Smith, killing Smith and his co-pilot, Lieutenant James Mallett Bennett. He had taken Smith and Bennett as passengers and testified to the inquest that the machine seemed to be in perfect working order. The jury returned a verdict of death by misadventure. Cockerell and his six-year-old daughter Kathleen were killed during World War II in the German bombing of Sunbury on Thames on 29 November 1940. His six surviving children were thus orphaned.