There were no immediate reports of deaths, injuries or major damage from the quake, which struck at 3:20 am (1020 GMT), rousing people from sleep as far away as San Francisco.
The epicenter was near American Canyon, 40 miles (64 kilometers) northeast of San Francisco, the US Geological Service said.
There was a "low likelihood for casualties," it said, but issued an "orange alert" for possible damage, a rating which means "significant damage is likely and the disaster is potentially widespread."
An 2.6-magnitude aftershock hit about 30 minutes afterward, it said.
USGS expert Jessica Turner told KCBS radio that aftershocks of up to 5.0 are likely in the next week.
The California Highway Patrol closed several off-ramps to highways and at least two roads in Napa Valley because of "significant roadway damage."
Drivers were cautioned to be careful at an intersection of two state roads in Napa Valley.
"Cracks in road may cause flat tires," it said on its Twitter account.
The highway patrol closed a bridge near Vallejo on Highway 37 while inspecting for possible damage, KCBS reported.
Power was knocked out to nearly 50,000 customers in Napa and Sonoma, which anchor two of California's most celebrated wine producing regions, according to the Pacific Gas and Electric Company.