Do you want legal, tested marijuana delivered to your door, without worrying that the police will show up next? Soon, that will be a reality in Massachusetts.

The Cannabis Control Commission on Tuesday voted to approve regulations that will allow marijuana home delivery services to operate legally within the state. The rules will also allow for marijuana cafes, where people can go with friends to eat, smoke or vape marijuana legally.

“We feel like we have got a good balance between trying to meet the will of the voters but recognizing that there are concerns from a public health and a public safety standpoint,” said Cannabis Control Commission Chairman Steven Hoffman.

The vote was 4-1, with Commissioner Jennifer Flanagan the only dissenting vote.

Flanagan said she thinks it is too early to allow social consumption and home delivery. “I think we need to stand up this industry, making sure the retail and cultivation and microbusinesses all get priority before we start to do home delivery and social consumption,” she said.

Flangan said she worries about public health. She noted that Massachusetts has a crisis of opioid addiction, and is now dealing with an outbreak of vaping-related illnesses. “We talk about social consumption, we’re looking for places for people to go and consume this product, mostly by smoking or vaping,” Flanagan said. “I have concerns about that.”

Both new types of licenses will be reserved for the first two years for social equity and economic empowerment applicants, which are categories of businesses owned by minorities, people with drug convictions and people who have lived and worked in communities disproportionately affected by marijuana prohibition.

Hoffman said home delivery licenses could potentially start being considered within “a couple of months,” after the commission develops and posts its application. But he noted that entrepreneurs will still have to negotiate agreements with host communities before they reach the state licensing process, as is the case with current retailers and growers. The commission has no control over how long that part of the process takes.

Although there is a long pending queue of applicants for retail stores and grow facilities, home delivery companies could jump to the front of the line in getting their applications processed if they fit into certain priority categories, like economic empowerment applicants.

Social consumption – which will start with a pilot program in up to a dozen municipalities that choose to participate – is expected to take longer to get off the ground. It appears that a legislative fix is needed to approve a process by which communities can adopt rules allowing social consumption, and it will be up to the Legislature whether to pass that fix. Once that happens, the commission could establish the pilot program.

The new businesses will be subject to the same types of rules as other marijuana businesses regarding things like employee background checks and avoiding diversion to people under age 21.

Applying for a social consumption or home delivery license will cost $1,500, with a $10,000 annual renewal fee, though fees are waived or reduced for economic empowerment and social equity applicants.

The launch of home delivery has raised safety concerns – for example, about the potential robbery of delivery drivers who are carrying large amounts of marijuana and cash. At a meeting of a Cannabis Advisory Board subcommittee earlier this year, Walpole Police Chief John Carmichael called home delivery “a tragedy waiting to happen.”

Gov. Charlie Baker said Monday that he worried about delivery drivers carrying around large amounts of cash until Congress changes federal banking laws to let marijuana consumers buy with credit cards.

The new rules establish security protocols so that home delivery trucks will need to be fitted with alarms, secure storage areas, GPS monitoring devices and cameras. Deliveries cannot be conducted between 9 p.m. and 8 a.m., and marijuana cannot be delivered to college dormitories. Communities will have some authority over whether to allow home delivery to their residents.

Delivery drivers will have to wear body cameras and record all transactions. This will let the police and state regulators to investigate improper transactions and crimes, but it has also raised concerns about customers’ privacy.

At Tuesday’s meeting, commissioners Shaleen Title and Britte McBride proposed, and the commission agreed unanimously, to require a law enforcement agent who seeks access to the video footage to obtain a court order or search warrant demonstrating probable cause, except in cases of imminent danger or emergency.

“No one will be able to go in and fish through that footage,” Title said.

At marijuana cafés, consumers will have to be informed about exactly what they are consuming – including product ingredients and quantity of THC - and warned about delayed reactions to marijuana edibles and the dangers of driving while impaired. There will be limits on the amount someone can buy at one sitting. Smoking will only be allowed outdoors if certain conditions are met regarding ventilation and avoiding impacts on neighbors. Marijuana cafes could only be open between 8 a.m. and 9 p.m.

Hoffman said state regulators will continue to collaborate with law enforcement and make any additional changes to security procedures that become necessary.

The state has also struggled to meet a legislative requirement that it ensure that communities disproportionately harmed by drug enforcement laws are able to benefit from legalization. Advocates for allowing home delivery say this is a type of low-cost business that could open up the industry to more minority applicants, those with drug records and all those who have less start-up money.

Title, a strong proponent of social equity initiatives, said, “I’m proud of implementing the will of the voters, who are clear that they wanted to see an industry that’s fair, that’s equitable, that has room for small businesses and isn’t going to be dominated by big conglomerates, and I think that we made a lot of progress towards that today.”