Storm warning tower
A light? A flag? two? What did that mean again here?
A storm warning tower, also known as a storm signal is a structure near a port, or on a land's end, or sometimes it is integrated with the lighthouse. The storm warning tower might be operated by the Harbourmaster or Lighthouse keeper. The goal of the tower is to warn people at sea, in port or those living in or near the port of a incoming storm.
Signals
The towers, can signal a storm with many different symbols. They can hoist special flags, or several flags, they can hoist shapes such as triangles or balls. The towers can have semaphore arms. Or illuminate a certain colour and number of lights to signal a warning at night.
The signal often indicates the direction and strength the storm is raging or expected from. Not all warning towers can signal all directions, based on the local meteorological situation, some directions never produce a storm. So it would be pointless to have a symbol for that. Simplifying the whole system.
Because ofthe local differences in weather around the world, many warning systems differ from each other in what the signals mean, or even when they start to warn. So it's adviced to look up in the books what each of them means before assuming something.
Removal
Not all storm signals that once stood along the coasts around the world still exist, as many has been found to be redundant with the invention of radio, and now the prevalence of the internet.

Coming from the Maritimes, Newfoundland specifically, I always found this fascinating as a kid, like the job, the person who'd be in charge of actually running the flags, etc. I dunno why but it was such a cool idea, perhaps the like 'trust' being placed in you by all these vessels, all these people, etc. Great answer to this prompt!
Thank you Keon!