The earthquake hit around 3:20 a.m. local time, the U.S. Geological Survey said, and could easily be felt by San Francisco Bay Area residents.
The USGS said the quake's epicentre was eight kilometres northwest of the town of American Canyon, about 60 kilometres north of the San Francisco.
The USGS says the depth of the earthquake was just less than 11 kilometres, and numerous small aftershocks have occurred in the nearby Napa wine country.
There were no reports of major damage, but images posted on Twitter showed kitchens shaken up ad some small damage done to building exteriors.
Power company PG&E said tens of thousands of customers in Napa and Sonoma — two tourist destinations known for their wineries — were without power. The company did not say when it expected to have electricity restored.
Thousands took to Twitter to register their shock, many tweeting that the quake woke them up.
On mobile? See the Tweets here, here and here.