The movie begins with an explanation of the relationship between Virgil Cole (Ed Harris), the gunman/lawman for hire, and Everett Hitch (Viggo Mortensen), a gradate of West Point who decided that the Army wasn't for him and he needed to discover himself in the wild, wild west. They met when Everett had backed Virgil in a gunfight about 12 years previously, and since then, the two had been inseparable, with Everett taking second fiddle to the infamous Virgil, working in various towns as marshal and deputy. They're gunmen who only shoot when it's legal: When they're hired to be lawmen for towns that seem to have too many bad guys.
Cut to Randall Bragg (Jeremy Irons), the largest area rancher outside the town of Appaloosa, who with his men terrorize the town and implement their own rules. The current sheriff and two deputies come to his ranch to arrest two of Bragg's men who murdered a man and his wife, but Bragg takes matters into his own hands and kills all three of them with a young ranch hand (Joe Whitfield played by Gabriel Marantz) watching on in horror.
So the city fathers meet with Virgil and Everett and accept Virgil's rules of the road: my way or the highway, no discussion or I'll move on to the next town. The city fathers have little choice, and it doesn't take but a few minutes and there's a disruption in a bar with two of Bragg's men urinating on the floor. Virgil and Everett wander on over and tell them that they need to stop, or head to jail. They don't stop, nor do they want to head to jail, and they draw on Virgil and he kills the two at the bar while Everett takes care of a third that appears out of a side room.
A day passes and Bragg and all his men come into town and meet with Virgil and Everett in a small bar. Bragg offers some way of reconciliation with Virgil, but as the last marshal/sheriff was Virgil's friend, he has none of it. It ends with a tense standoff and Virgil telling them that they can't even bring weapons into the town from then on.
Enter Allison French (Renee Zellweger), fresh off a train with only a dollar to her name. Everett spots her first and follows her to a small restaurant where Virgil is also having breakfast. Both men seem to want to court her, but Everett gives way to Virgil, who seems smitten. Once he declares himself the city marshal, Allison smiles and flirts. In turn, Virgil promises her a gig at the local hotel where if she plays the piano, she can probably stay for free (which is the only work available as she says she isn't a whore.)
Back at the law office, Everett and Virgil talk about Allie (what she likes to be called) a little, with Everett egging on Virgil just a bit, but obviously letting (and encouraging) Virgil to pursue Allie. They then see some riders on top of a hill that overlooks Appaloosa and decide to go and investigate. When they get up there, they have a mild confrontation that involves Virgil whacking one man with the butt of his pistol to make a point that Bragg has no power anywhere, inside or outside of the town.
In a bar, Virgil's nasty temper flares and he attacks a rowdy man after he swears in Allie's presence. Virgil beats the man so badly Everett has to stop him. It's apparent that Virgil is a man with a clear sense of right and wrong, not complicated by shades of gray. He's doesn't let much get to him, but when he gets upset, he is uncontrollable. Everett later apologizes to the man and gives him a drink. When a town father asks him why Virgil doesn't apologize, Everett explains that that isn't Virgil and if they want the town protected, they'll have to take the good and the bad, as they hired the man.
A day or a week or more is implied to have passed and during breakfast, Allie comes down with Virgil (obviously they just slept together) and announce that Virgil is going to be making her a house in town and they'll live there together. Everett is obviously surprised and mildly upset that his friend hadn't told him, but congratulates them and says nothing. Breakfast is interrupted when Joe Whitfield comes in and says that he saw the killings and will testify. They cross examine him and make sure the kid is up for the task and when it appears that he is, head out to get Bragg. They catch him in the outdoor privy and drag him back at gunpoint into town through his angry (but obedient) men. Now comes the round the clock guarding of Bragg, who unfortunately has a cell right next to Joe and makes some threats that shake the younger man up.
Meanwhile, Allie's house is slowly getting built. Virgil doesn't know how to handle some of her requests and sends Everett over to deal with her a little. When Everett gets there, Allie corners him and kisses him, but after a few seconds of enjoying it, pushes her off and tells her that when they are not together, they're both with Virgil. Allie, obviously stung, asks him to leave. Everett says nothing about it to Virgil, but does to the hispanic prostitute he's been visiting and she tells him that eventually Allie will tell Virgil and he should be prepared for the 'not-nice' spin Allie will put on it.
Two other lawmen come into the office and said they came with the judge. They offer their help to watch Bragg and Virgil thanks them and accepts. The Shelton brothers (Mackie and Ring) come into town, they're very good hired guns. Virgil knows them but unlike him, they go out for hire for legal and illegal purposes. After a small discussion, Virgil makes it clear who is in charge and the two brothers go into the hotel after witnessing Virgil and Allie go out for a country picnic in a carriage.
The trial starts and while all the Bragg boys testify for him, the damning evidence is presented by Joe, and even Bragg's loquacious oratory that comes afterwards doesn't save him. After testifying, the boy is told by the judge to get on his horse and ride out of town for his own safety, and the judge orders Bragg hanged in another city (to be taken by train.) As the sentence is handed down, Bragg makes eye contact with the Shelton brothers.
On the train things seem to be going quietly, but soon it stops for a refill of water and the Shelton brothers appear on a dry riverbed under the train and show they have Allie tied to a horse. They threaten to kill her if they don't release Bragg. Virgil agonizes for a few moments and then gives up Bragg, but per the agreement, doesn't get Allie until they decide to release her. Virgil is frustrated at losing his prisoner, and goes after them on foot while Everett goes back to town via the train to get horses.
They meet up again after a day while Virgil has been tracking on foot the Shelton brothers, Bragg and Allie, and now on horseback catch up to the group. They see a bunch of Indians coming towards the group and then Everett and Virgil see Allie frolicking in a river naked with Bragg. Both lawmen appear distressed, but more concerned about the Indians about to ambush the four people. The Indians do ambush them and Virgil and Everett fight them off, killing one of the Indian's horses in the process. Virgil then makes a deal with the brothers that they all will put aside differences until they're out of ambush range, after that they'll settle them. When Virgil and Everett are on guard duty, Allie comes up and sits between them, saying how scared she was and how it was a mistake. When Virgil asks Everett if he thinks that she'd sleep around again, Everett replies that "Allie needs a man." Allie then tries to say that Everett touched her, but when Virgil asks Everett, he denies that it happened like Allie says. Virgil then makes it clear that he believes Everett's version over Allie.
They wait a while, expecting to be attacked, but then Everett takes Bragg's expensive thoroughbred horse and gives it to the Indians, making peace with them and they head on their way. They come to a small town where the two brothers and Virgil decide to have their showdown. As Virgil and Everett rest before their shoot out, Everett makes a note that Allie's not a loose woman, she just wants to be 'the woman' of the stallion of the herd. The problem is, the stallion changes from time to time. Virgil still makes it clear that even with Allie being how she is, he cares for her and wants her. Allie comes in, obviously scared. When the men tell her that they're not scared because it's part of the job, she replies that she's always scared that she'll lose everything and have nothing. Virgil states he'll always look out for Allie, for as long as she needs him.
As they walk over to the stockyards to have it out with the Shelton brothers, Virgil and Everett find out the town Marshal they entrusted with Bragg is a cousin of the Sheltons. The Marshal, Bragg, and the Shelton brothers get the drop on them, making it four on two. Virgil shoots one of the brothers and the Marshal and Everett kills the other brother, but misses Bragg, who rides away on a horse. Both Everett and Virgil are wounded, but not fatally. Allie runs to Virgil's side, fearful that he may be dying.
After a period of time, they finish building the house. Virgil's left knee was left permanently impaired and he wears a brace. They can even laugh a little at everything that happened, including Allie's indiscretions. The town's leadership tell them that Bragg was pardoned by the President of the Unites States, who Bragg had claimed to know, but everyone thought it was just a story. Some time later, Bragg arrives in town dressed like a gentleman, wearing a fine suit, announcing that he has reformed. He buys and refinishes the hotel. It is unclear if he got his money in an illegal way. He tries to make peace with Virgil, but the man will have none of it and Bragg's actions make it clear that the town fathers are in his pocket, Virgil's days as the Marshal are numbered.
Virgil and Everett have a talk, with Everett saying that there isn't really work in Appaloosa for a guy like him. Virgil refuses to leave because Allie is there and is okay with Everett moving on if he has to. Everett has watched Allie go upstairs to Bragg's room at the hotel, obviously she had sensed the power change. She doesn't look happy about it, but she does it.
The next day Everett gives a necklace to the Hispanic girl and tells her the name of the one man who he had killed without being a lawman, sounding disappointed at himself about it. He says he's leaving. He takes his horses and rides to the hotel, going into the bar and laying down his badge and a gun to the barman, saying that it's for Bragg. Everett then goes over to Bragg and punches him and challenges him to a duel. He then slaps him, infuriating him and insulting his pride before walking outside to wait for him. Bragg gets the gun and storms out of the hotel.
Meanwhile, Everett's woman alerts Virgil that Everett is leaving, and arrives with Virgil to the hotel. Virgil asks Everett what is happening, but Everett asks him to step aside, noting that he's never asked Virgil for anything before but is asking now. The shootout happens in a second and Bragg falls dead, Everett doesn't get a scratch on him and he mounts his horse and rides out of Appaloosa. It ends with a narration from Everett saying that he gave Allie and Virgil more time to work things out and he's on the road to discovering more about himself again.