After the war Riley moved to Lincoln County where he formed a business partnership with two other Irish immigrants, James Dolan and Lawrence Murphy. In 1874 the men established the Murphy & Dolan mercantile and banking operation. The company was highly successful and won contracts to supply beef to both the Mescalero Apache Reservation and Fort Stanton.
Lawrence Murphy and his friends were disliked by the small farmers in Lincoln County as they were forced to pay high prices from Murphy & Dolan while at the same time they had to accept low prices for their cattle.
In 1876 Alexander McSween and John Tunstall set up a rival business. These two men were given the support of John Chisum, the owner of a large ranch and over 100,000 head of cattle. McSween and Tunstall now established J. H. Tunstall & Co, a shop and bank close to the one owned by Dolan, Murphy and Riley.
Dolan was furious at this development and attempted to goad Tunstall into a gunfight. Tunstall refused to use violence himself but he did recruit Billy the Kid to help him in his business dispute. On 18th February, 1878, Tunstall was killed by a gang of men that included William Morton, Jesse Evans and Tom Hill. This incident started what became known as the Lincoln County War.
Billy the Kid was deeply affected by this murder and claimed that Tunstall "was the only man that ever treated me like I was a free-born and white." Apparently at Tunstall's funeral Billy the Kid swore: "I'll get every son-of-a-bitch who helped kill John if it's the last thing I do."
Billy the Kid joined the Regulators, a group led by Dick Brewer that supported Alexander McSween. It was claimed that John Tunstall had been murdered on the orders of James Dolan and Lawrence Murphy. Rumours began to circulate that Dolan had offered $1,000 for anyone willing to murder Alexander McSween. Over the next few months the Regulators killed Sheriff William Brady, George Hindman, Frank Baker, William Morton, Buckshot Roberts and others who they claimed they had been involved in the killing of Tunstall.
On 19th July, 1878, McSween and his supporters, including Billy the Kid, were besieged by Sheriff George Peppin and a group of his men. McSween's house was set on fire and several people were shot dead as they came out of the house. This included the unarmed Alexander McSween. No one was ever convicted of this murder.
When Lewis Wallace took office as Governor of New Mexico on 1st October 1878, he proclaimed an amnesty for all those involved in the Lincoln County War. It is estimated that nineteen men were killed during the conflict.
Riley moved to Las Cruces where he got married in 1882. Later he established a hog ranch in Colorado.
John Riley died of pneumonia on 10th February, 1916.