He entered the Royal Navy on 1 September 1799 aged eleven as a cabin boy under Captain Andrew Todd on in the Mediterranean with the fleet of Lord Keith. On 17 March 1800 Loch narrowly escaped death when the ship was destroyed by fire and blew up killing 673 men off the Italian coast near Leghorn. Loch was one of the few survivors. Loch served as a midshipman aboard , aad . He was present at the blockade of Genoa in May 1800 aboard "Minotaur". Still with Lord Keith's fleet, he joined under Captain John Stewart. He was placed on the island of Rhodes overseeing the equipping of gunboats bound for Egypt and Lake Mareotis early in 1801. He took part in the landings at Aboukir Bay and was among the party that cut out a Greek vessel from under the guns of the castle overlooking the bay. He then joined and then until November 1801 before transferring back to "Foudroyant". He returned home in 1802.