Simply go to the merchant alliance at any outpost, buy the flag for 20,000 coins. Your pirate should be level 15 and have promotions before you can purchase flag. Go to the table beside the merchant and raise the flag for the achievement to pop.
As the update has come out, it has been glitchy buying such flags but I managed to do 2/3 of the flags. Restarting the game might help.