Until the building was habitable the troops were housed in the buildings of the old Mission. While the barracks was built to house troops, most of the space was used as a headquarters and for supply, equipment and weapons storage.
The Company's commander Lieutenant Mariano Vallejo was named Military Commander of the Northern Frontier so the Company was also responsible for maintaining control over the Native population north of the Bay. Vallejo's approach to controlling the border region combined direct military action, treaties area with native groups, and forming alliances with Indian leaders on the west, Chief Marin and east, Chief Solano - who provided auxiliary men when the Company way fighting other Native groups. During the years that Company was based in Sonoma they rode out over 100 times to maintain control over the area's Indian groups.
The Company did receive support in money and materiel from the Mexican and California governments but Vallejo absorbed the deficits out of his own funds. All the other presidial companies in Alta California had been replaced by civilian militias by the time the San Francisco Company moved to Sonoma.
Lieutenant Colonel Vallejo disbanded the Presidial Company on November 28, 1844 with the plea that he could not longer afford paying for them. Among his other reasons may have been avoiding being drawn into a rebellion against Governor Micheltorena by his nephew Juan Alvarado and childhood friend Jose Castro. After releasing the soldiers, Vallejo retained the weapons and military supplies stored in the Barracks for the use of the civilian militia. (Nine old cannon of various sizes, two hundred long infantry muskets, fifty carbines, cannon and musket balls and a small amount of black powder.) The Sonoma Barracks was also, for a short period, the home and headquarters of the Compania de Infanteria Permanente de Sonoma, a regular Mexican Infantry Company composed of young, not-so-willing Californio draftees.
On June 10, 1846 a group of dissatisfied and fearful American immigrants with a murky relationship to U.S. Army Brevet Captain John Fremont had captured a herd of Californian government horses which they feared would be used against them. They next determined to seize the Pueblo of Sonoma to deny the Californians a rallying point north of San Francisco Bay. Capturing the arms and military materiel (stored in the Barracks) and Lieutenant Colonel Vallejo would delay any military response from the Californians.
Before dawn on Sunday, June 14, 1846 thirty-three of the American rebels arrived in Sonoma. They accomplished their objectives, without ever firing a shot, by 11:00 AM. At that time, Vallejo and three of his associates were placed on horseback and taken to Fremont near Sacramento with eight or nine of the insurgents who did not favor forming a new republic. The Barracks became the headquarters for the remaining twenty-five who founded the new California Republic and created its Bear Flag. The rebellion subsequently became known as the Bear Flag Revolt.
Other immigrants and their families began moving into Sonoma to be under the protection of the muskets and cannon taken from the Barracks. Some families were housed in the Barracks - others in the homes of the Californians.
Fremont and his mapping expedition group arrived in Sonoma on June 24, throwing off any pretense of neutrality. On July 5 Fremont proposed to the Bears that they unite with his party and form a single military group under his command. A compact was drawn up which all volunteers of the California Battalion signed or made their mark. The next day Fremont, leaving the fifty men of Company B at the Barracks, left with the rest of the Battalion for Sutter's Fort They took with them two of the captured field pieces as well as muskets, a supply of ammunition, blankets, horses, and cattle.
Seven weeks after war with Mexico had been declared in Washington, D.C., Commodore John D. Sloat, commander of the U.S. Navy's Pacific Squadron, after being assured that war with Mexico had been declared, instructed the captains of his ships to occupy Monterey on July 7 and Yerba Buena (now San Francisco) on July 9. Early on July 9 - Navy Lt. Joseph Revere was sent to Sonoma carrying two 27-star United States flags for the Sonoma Barracks and Sutter's Fort (the squadron had run out of new flags that reflected Texas’ admittance to the Union). Raising the American flag in front of the Barracks marked the end of the Bear Flag Revolt and the California Republic.
The majority of the California Battalion was transported to San Diego by the U. S. Navy to assist in securing California for the United States. The Barracks served as housing for a number of former Bears and their families after the Battalion left. Most of the those remaining Bears eventually returned to their homes. The Sonoma Alacade complained to the U.S. Navy about the lack of protection for the town and a detachment of US Marines was assigned to the Sonoma Barracks. The Navy completed the planking of the second floor, raised the roof and replaced the roof tile with shingles.
In March, 1847, the Marines were replaced by Company C of what was called Stevenson's New York Volunteers. The enlistments of the New York Volunteers ended with the war and they were replaced in May, 1849, by a 37-man company of U.S. dragoons (Company C, 1st U.S. Dragoons) who moved into the Barracks and established Camp Sonoma. Sonoma lost its military population in January, 1852, when the troops moved to Benicia and other assignments in California and Oregon. The Army continued to use part of the Barracks as a supply depot until August 1853.
Soon after the military left the building Vallejo filed a claim of $20,600 with the U.S. Army for back-rent. After several years the claim reached the Court of Claims where it was contested by the U.S. Solicitor General on a number of bases. The Court awarded Vallejo a reduced amount ($12,600) based upon a lower rental rate and shorter rental period than was originally claimed.From the 1850s to the 1870s, the building was used as a winery and to grow silk worms experimentally. Sold to Solomon Shocken in 1879, the barracks then became a grocery store before being sold to the Murphy's, a local couple, in the 1930s who used it as a residence. It was finally transferred to the Sonoma Historical Society in 1957 and was restored as part of the Historic Sonoma Parks.