Roughly 1830-1890. I am referring to frontier territories before/during the westward expansion. There were mining/cattle towns (eg Deadwood). There was no official federal or state government yet.
They operated under a free market obviously (you could trade with anyone, no taxes or levies). Disputes were resolved through arbitration or informal courts. They relied on private lawmen or hired security (Pinkertons)