The population of California grew 20-fold in 12 years (1848-1860). All those people needed to buy things. Merchants were willing to satisfy this demand, but not too many things were produced in California at the time.
That meant imports, and imports meant customs duties. By US law, duties had to be paid in US gold coin—not in gold nuggets. Merchants were so desperate for coin that many minted their own—with varying degrees of similarity to the official, US-minted money.
The suppression of self-minting led to a shortage of circulating currency, which caused customers to worry that the banks would not be able to honor their deposits. Most of the customers were armed, and many considered their deposits of far more value than human lives, so the bankers had good reason to be worried as well.
Bringing real US gold coins from the Eastern mints was briefly contemplated. Then everyone laughed at the thought of shipping wagon loads of gold across a barely-settled country, and on July 8, 1852, President Millard Fillmore signed an act authorizing a branch mint in California.
Two years later, the San Francisco Mint was completed. Machinery and volunteers arrived from the Philadelphia Mint. Even at that last moment, the mint's fate was uncertain, as a customs officer demanded storage duty and port charges, as even Uncle Sam was not exempt from paying his dues to Uncle Sam. The Mint Treasurer, Jacob R. Snyder, had no ready funds with which to pay any kind of expense and the matter took some time to resolve.
In debt to everyone and for everything, the SF mint finally started operations in April 1854, with Adams & Company Express depositing the first gold bullion. On the first day, over $200,000 in gold was deposited and by April 19th, the mint struck its first coins. By the end of its first year it produced over four million dollars of currency. That’s just over $166 million in today’s dollars, in case you’re wondering.
Working conditions in the mint were not the best. In fact, it was so cramped there that the poet Bret Harte, who served as clerk and later secretary to the Superintendent of the Mint from 1863-1869, had to have his desk next door, in the offices of The Morning Call. It’s there that he met Mark Twain. Twain later said that Harte “...trained and schooled him so patiently until he changed me…to a writer" Neither of them was the most interesting person on this block. That distinction belongs to "Count" Agoston Haraszthy.
If you have time, go into the Pacific Heritage museum to see the original mint’s vault and their always-interesting changing exhibitions on the cultures of the Asian-Pacific region.