Origin of "On The Wagon" meaning sobriety

What are the origins of the phrase, “On the Wagon”, meaning alcohol sobriety?

Why do so many use this phrase when describing someone who has temporarily, (or even permanently), abstained from drinking alcohol? And what is the opposite of being “On the Wagon”?

The opposite of “on the wagon” is “fell off the wagon”.

Drunk. :wink:

Slight hijack
Andy Sipowitz, from NYPD Blue. an alcoholic, mentioned "getting his nut on’ when he was drinking. Was he referring to getting drunk enough so it was time for bed, or what?

I remember seeing a photo of an old west temperence parade - the teetotalers were riding a horse drawn wagon with signs and musical instruments. So maybe you got on the wagon when you gave up demon rum. A drunk falling off a wagon sounds like something that would not have been rare at any time.