A year ago, Joshua To set out to build a 640-square-foot home made of four metal shipping containers in the backyard of his Menlo Park home. A design director for Google by day, To also runs a nonprofit called Soup that uses innovative design to tackle problems such as the Bay Area’s affordable-housing shortage.

When I first met To and his wife, Sara, in January 2017, they had just teamed up with Honomobo, a Canadian manufacturer of container and prefab homes. This would be Honomobo’s first permitted container home in California, and an experiment for Soup, to see if containers could provide economical housing at scale.

To once lived in a shipping container without heat or plumbing in Half Moon Bay for a year and “saw the value of keeping costs low and saving money,” he said.

Although Honomobo’s tricked-out container homes are not necessarily cheaper than traditional construction, they’re quicker to install and don’t require general contractors, who are in short supply. They come out of the company’s factory near Edmonton, Alberta, painted inside and out with windows and patio doors, flooring, electricity, plumbing, kitchen and bathroom fixtures, closets, washer-dryer hookups, heat and air conditioning — everything except furniture and appliances.

To’s move comes at a time when California is pushing cities to eliminate some barriers homeowners face when they want to build “accessory dwelling units,” often called ADUs, in-laws or granny flats. Lawmakers in Sacramento see them as a source of affordable, infill housing financed by homeowners. Second units “rent for 30 percent less than a comparable apartment in the same community,” said Matt Regan, a senior vice president with the Bay Area Council.

Two laws that took effect early last year, SB1069 and AB2299, streamline the permitting process and prevent local jurisdictions from requiring new off-street parking if public transportation is within a half mile. They also forbid utility hookup fees that are not proportionate to the size of the accessory unit. Many utilities had been charging the same hookup fees on in-laws and McMansions. If the accessory unit is built within the the primary home’s existing space, no hookup fees or off-street parking can be required. Two laws passed last year, SB229 and AB494, clarified some gray areas in the previous two laws.

Steve Vallejos, whose firm Valley Home Development has been building accessory units in the Bay Area since 2006, said the latest legislation “seemed to get people off the fence.” He typically signs two or three design deals per month. “This month we signed 10,” he said. He expects to complete 80 to 100 units this year, up from 15 to 20 a year in the past.

California’s large cities have embraced the concept, Regan said. “Los Angeles prior to the passage of SB1069 was averaging less than 100 ADU permits a year. In 2017 they issued over 2,000.” San Francisco issued 593 permits in the first nine months of last year, up from 384 in all of 2016 and 41 in 2015, according to a report by the Terner Center. The city’s planning department put out a “fantastic guide” for homeowners considering an accessory unit, Regan said.

But even when cities are supportive, building a second unit is not easy, fast or cheap. “The Bay Area has a lot of red tape, no question,” said Daniel Engelman, co-founder of Honomobo.

The Tos applied for a permit from Menlo Park a year ago. “First they said the new unit (which is sleek and modern) didn’t match the look of the main unit built in the 1940s,” To said. “We had to write a letter saying how we would make it similar.”

The city also made them demolish shelving and a wall the home’s previous owners had put in the garage without a permit. Then they had to get an arborist to make sure their digging wouldn’t disturb tree roots.

To get an address for the new two-bedroom unit, they had to fill out a form and pay $50.

They needed a boundary survey ($2,475) and a geotechnical study ($2,670). To called about 50 companies for each before he found ones willing to do it.

He called 20 companies to pour the foundation. Most wanted $80,000 to $100,000, but one did it for $20,000 because he believed in the idea.

Because the home is in a flood zone, he had to get two elevation certificates totaling $1,500.

In addition, the Tos owed Menlo Park $8,985 for a permit, plan reviews, inspections, a geologist, a “technology surcharge” and other fees. This total included $1,295 of “impact” fees, which local jurisdictions can charge to pay for infrastructure needs that development brings.

They also had to pay $2,227 in impact fees to their elementary and high school districts.

Meanwhile, the U.S. dollar was weakening against the Canadian dollar, which increased the cost of the containers.

It was like “death by 5,000 paper cuts,” To said.

The city sent To’s plans to a dozen neighbors, including seven whose property borders their nearly 10,000 square-foot lot. The family had made it a point to get to know their neighbors after they bought their modest home in 2016, and none objected to the plan.

In fact, their rear-yard neighbor allowed the home to be placed 5 feet from the property line, instead of the usual 10-foot setback. Two other neighbors agreed to have a fence removed so the containers could be moved in.

“I really think it’s important to have affordable housing, and this is a really exciting project,” said one of those neighbors, Cindy Stead. “It did take neighborhood cooperation for it to happen, and that’s what we need right now.”

The Tos finally got their permit in October, had their foundation poured in November and scheduled the big move for Friday, Jan. 12.

Honomobo buys containers, for about $5,000 each, after they’ve made a single one-way shipment from China. That way it can be sure they are not bent out of shape and haven’t carried anything toxic. Each container is 40 by 8 feet and 9.5 feet tall. To’s containers were cut down to 22 by 8 feet, which included a 2-foot overhang around the home. Honomobo turns off-cut pieces into a 96-square-foot mini-unit called the Obo that retails for $25,000. To got one of those to use as a backyard studio.

Normally Honomobo uses a crane to lift containers over the main house, but in To’s case, power lines were in the way, so the company hired two giant Gradall forklifts to transport them. The day of the move, the containers arrived on flatbed trailers, filling the neighborhood with noise and excitement. The Tos provided giant pizzas and drinks to neighbors and crews.

The plan was to get them installed in one day. But it wouldn’t be a construction project if things went according to plan.

First the forks on the forklift were too small, and new ones had to be found. Then the forklifts got stuck in the mud. Large steel plates were brought in to put under the tires, but when they ran out of steel plates, work ended for the day. It took three more days before the project was finished.

To plans to use the container home as a “show unit” for Soup and Honomobo for a few months, then rent it to a low-income tenant.

Engelman said To’s model retails for $185,000, but “Josh got a deal because he’s the first.” Including foundation, site work, installation and fees, he estimates the total cost without a discount would run $250,000, or $390 per square foot.

To thinks his cost would have been more like $300,000 without a discount (which he declined to disclose) because his site was so difficult to build on.

Vallejos, whose firm does conventional, modular and panelized construction (where the framing is built in a factory instead of the job site), said his units are running $280 to $320 per square foot excluding design, permit and impact fees. Design fees run around $9,800 for a standard plan or $12,000 for a customized one. Permit and impact fees, he said, range from $5,000 in some cities to $40,000 or more.

A bill introduced this month, SB831, would prohibit impact fees on accessory units. It also would prohibit utility hookup fees unless the homeowner wants a separate meter and bill.

Engleman said if he had to do it again, he would not use a shipping container at To’s home but a steel rigid frame with structural insulated panels because it’s cheaper and easier to install.

When To started his project a year ago, he thought it would take three to six months. “If we knew everything we know today, I think we could do it” in that time frame, he said.

To said he is proud of his container home and thinks it would work for other homeowners, “especially if folks like the aesthetic.” But for his nonprofit, which wants to build affordable homes at scale, “factory-built from scratch with lumber and steel would make a lot more sense from a cost standpoint.”

Kathleen Pender is a San Francisco Chronicle columnist. Email: kpender@sfchronicle.com Twitter: @kathpender