On the Evening of September 12th 1914 the German light cruiser SMS Hela was steaming near the island of Helgoland off the north German coast. Little did her captain know that the next morning there would be an encounter with one of the newest branches of the Royal Navy, and the aftermath of that encounter would create a new tradition.
The next morning the Submarine HMS E9, commanded by Lieutenant Commander Horton, surfaced briefly, spotted the Hela and immediately submerged again. The Hela hadn't seen the Submarine, and when E9 was within 600 yards two torpedoes were fired. Both struck the Helaamidships and she began to take on water. 30 minutes after the Torpedoes hit Hela sunk, becoming the first ship sunk by a British submarine. Only two of the Hela'screw were lost. The Imperial German navy launched a furious hunt for E9, however despite searching all day despite this E9 evaded their detection. When entering Harwich harbour LTC Horton flew the Jolly Roger as a sign of his success.

SMS Hela

LTC Horton's choice of flag came from the words of Admiral Sir Arthur Wilson. Who had won a VC by launching a lone charge into hand to hand combat against Mahdist troops (fuzzy Wuzzy's) during the Sudan war. Admiral Wilson had decried Submarines as "Underhanded, Underwater and damned Un-English. Certainly no occupation for a gentleman!" He went on to say "We should treat all Submariners as Pirates in wartime, and hang the lot of them!”
LTC Horton then went on to fly an extra Jolly Roger for each successful patrol E9 undertook, until he had room for no more flags. E9 spent allot of her patrols in the Baltic intercepting Swedish Iron ore shipments to Germany. He became such a thorn in the side of the German economy he was portrayed as a buccaneer, with the German press screaming headlines about "The underhand and criminal methods of the British Pirate Submarines!"

A red Jolly Roger was flown by the submarine HMS E12 as she operated in the Sea of Marmara, alongside HMS E11. I haven't been able to find out if E11 also flew that flag, but considering E11's exploits I don't think she needed to!
HMS E11 was commanded by LTC Nasmith. On the 18th of May, 1915, LTC Nasmith captured a Turkish vessel in the Aegean Sea. Tying his submarine to the captured vessel he sailed right past all the Turkish shore batteries, and into the Sea of Marmara. He set course for the Golden Horn (the area outside Constantinople harbour) immediately.
When he arrived he spied a Turkish heavy gunboat and fired two torpedoes at it. The first one missed and drew a huge circle forcing LTC Nasmith to have to dodge his own shot! The errant torpedo then hit a wharf detonating loudly. The second torpedo hit the Gunboat sinking it. Panic gripped the City, Traders started boarding up their shops, and people ran for home. Troops embarked on transports for the fighting at Gallipoli were ordered to disembark to defend the city.

E11 stayed on patrol for a further three weeks reaping a huge toll on the crowded sea. Many of LTC Nasmith’s kills were done by boarding ships and placing scuttling charges on the ship. E11 managed to keep its patrol up so long by its boarding parties stealing food from ships they boarded. LTC Nasmith also modified his torpedoes so they would stay afloat if they missed the target. Then the Commander would then swim out to the live torpedo, and disarm the warhead while swimming alongside it in the sea. The torpedo would then be returned to the submarine and refuelled for use later on.
After three weeks blockading Constantinople, Nasmith finally started to withdraw, heading back to the Dardanelles. On his way he learnt of a large coal transport heading for Constantinople. LTC Nasmith turned around and followed the transport. The huge haul of coal would have improved the cities position no end. Power supplies were sketchy, and morale was suffering. The coal shipment would have solved those issues. There was a huge crowd including local dignitaries waiting for the coal freighter. The crowd cheered when the freighter tied up alongside. Then LTC Nasmith's torpedo struck sending the ship and its cargo to the bottom of the harbour.
When LTC Nasmith returned he was awarded a VC for his patrol.

E11 was refitted and fitted with a 12Pdr deck gun. LTC Nasmith took it for another patrol in the Sea of Marmara. Within hours of starting his patrol he surfaced alongside a coastal road, and put his new weapon to work shelling a column of Turkish troops marching to the Gallipoli fighting. Next he sunk the Turkish battleship Hayreddin Barbarossa off Bolayır with a single torpedo.
His final act of daring was in collusion with First Lieutenant D'Oyly-Hughes. Creating a raft and filling it with explosive Lt D'Oyly-Hughes swam ashore and packed the charge into a culvert next to a railway viaduct. The viaduct had been shelled several times by E11, with little lasting effect. Lt D'Oyly-Hughes was chased back to the beach by Turkish ground forces, and despite being shot at managed to reach the safety of E11. When the charge blew it took out the entire viaduct.
E11's patrol lasted 47 days, a record not beaten in the Great War. During that time LTC Nasmith sunk 1 Battleship, 11 steamers, 5 Large sailing craft, 30 small sailing vessels and a number of Gunboats.

The last time the Jolly Roger was flown from a Royal Navy submarine was in 2011 when HMS Triumph returned to port after firing cruise missiles in Libya. However the last time it was flown for scoring a shipping kill was shortly after the USS Phoenix was sunk. The Phoenix, a survivor of the Japanese attack on Pearl Harbour, was sailing in the South Atlantic when she was struck and sunk by two Torpedos’. The British submarine that had fired them was HMS Conqueror, and the date was May 2nd, 1982. The USS Phoenix had been sold to Argentina and renamed the ARA General Belgranao. Interesting to note that the first (and only) kill by a Nuclear submarine was done with World War Two era torpedoes, as the captain of the Conqueror was unsure how well his modern torpedo would cope with the Phoenix's armoured hull.
When returning to base, as tradition allowed, the Conqueror decided to fly a specially made Jolly Roger. However there was nowhere to fly it from, so a broom was tied to the periscope and the flag flown from that, or so the story goes.