It all started at the Alpine Inn Beer Garden, a biker bar in Portola Valley, California, better known to regulars as Rossotti’s, or just Zott’s.

On Aug. 27, 1976, a team led by Don Nielson, then assistant director of telecommunications at Menlo Park, California, engineering firm SRI International, drove a specially equipped van 6½ miles south and parked at Zott’s. They ran a cable from the van’s radio to a computer set up at a picnic table out back and used the radio to connect to another computer at the SRI office and on to Boston. The Internet was born.

Forty years later, people read the news on their phones, book beds in strangers’ homes, stalk their friends on Facebook, post videos on YouTube, program their vacuuming robots and fitness-tracking watches, and chase invisible monsters through city streets. They also get hacked, spammed and harassed on a scale unimaginable at Zott’s in the ’70s, when the worst thing that might happen was getting cussed out for touching the wrong character’s motorcycle.

The digital future, with all its risks and opportunities, began to unfold that August day. But it was hard to imagine that at the time, even for Nielson.

“It is just too easy for people to think this was the beginning of the Internet,” Nielson wrote in an email. “It is nice to see the event noted, but the capital-I Internet is so very much more.”

Without the capital I, an internet is just a network of networks — more than one network connected together. That August day was actually among three contenders for the birth of the Internet — the network that, 40 years later, spans the globe and defines modern life.

In November 1977, Nielson’s team did another test that showed even more promise. They successfully connected their packet radio in the van to computers in Los Angeles and London.

That, Nielson said, “illustrated with certainty that you could internetwork any place in the world. Distance was no longer an obstacle.”

In the 1970s, Nielson’s team used the still-experimental Transmission Control Protocol and Internet Protocol to run their tests of what would one day become the modern Internet. That network would get far bigger in 1983, when the Department of Defense switched its research network, Arpanet, to run completely on TCP/IP.

As the Internet was getting its footings in the ’80s, Richard Bennett was developing networking software for Texas Instruments. The company had a corporate network connecting 70,000 employees and an internal electronic mail system.

Larry Downes was also experimenting with an external mail system at his job at Andersen Consulting, now known as Accenture. He thought the Internet was an “academic toy” that showed no commercial potential. It was clunky and difficult to use.

Downes, and many other doubters along the way, would soon be proved wrong.

In 1991, Sen. Al Gore of Tennessee sponsored a law that allowed for commercial use of the Internet. (In a 1999 interview with CNN, Gore described his role as taking “the initiative in creating the Internet,” a statement that drew widespread ridicule.) UUNet, PSINet and Sprint emerged as some of the earliest Internet service providers.

The same law also helped fund the National Center for Supercomputing Applications, which opened a site at the University of Illinois at Urbana-Champaign. There, a graduate student named Marc Andreessen decided to build a browser for the World Wide Web, a system created by European researcher Tim Berners-Lee, which let people access words and images stored on any other Internet-connected machine.

Downes remembers seeing Andreessen demonstrate his Web browser, Mosaic, at an industry conference in the early ’90s. His presentation “blew everyone’s mind,” Downes said.

“The audience went berserk,” Downes said. “There was this moment where everyone realized everything we knew about computing was about to be undone, tossed and remade.”

Andreessen’s work on Mosaic led to Netscape, whose initial public offering in August 1995 kicked off the dot-com boom and put Web browsers on millions of computers. For many businesses and consumers, access to the Web was the main reason to get on the Internet in the first place. Yahoo, Excite, Infoseek and other Web portals followed. Google, started as a research project by Larry Page and Sergey Brin at Stanford in 1997, would eclipse them all.

Google, which allowed anyone to find almost any information stored on the Web, was an example of the Internet’s purpose, said Bennett: “It was the abolition of distance as a constraint on communication.”

In 1980, Paul Vixie dropped out of San Francisco’s George Washington High School so he could program instead of going to class. Despite his lack of a diploma, he got a job at Digital Equipment Corp., where he worked on connecting DEC’s network with the rest of the world.

“Even though I was an employee at this company, I felt a greater affinity for the larger Internet community,” Vixie said. “We had broadened our clan, and that was fun.”

Vixie started getting emails from people in other countries as they, too, joined the Internet.

“This was also very exciting,” Vixie said. “It became this global force without any government assistance. It was a whole bunch of people saying, ‘Hey, let’s talk to each other more.’”

Vixie loved that people could use the Internet to learn about people and cultures they didn’t know.

“Humanity was trying to progenerate a collective digital nervous system and become a group mind,” Vixie said.

But that nervous system would get infected. “Spam was waiting in the wings,” Vixie said.

He entered a fraught battle with Sanford Wallace, the self-acclaimed “Spam King.” After getting kicked off of every Internet service provider for sending spam, Wallace created a program in 1995 where he would give people free computers and an Internet connection so long as he could use their connection to send spam.

Frustrated, Vixie started the first antispam company, MAPS, the next year and shut down Wallace’s operation, Cyber Promotions. He’s spent the past 15 years at various companies trying to prevent unwanted communication — spam, hate speech, malware — for which he feels vaguely responsible.

“The Internet was never anybody’s to control,” Vixie said. “Nobody could have forced it to be one way or another. I would have paved a few roads differently if I knew how big it was going to get.”

Spam has also spurred regrets for Nielson. The cost, he says, is incalculable.

“You can’t put the genie back in the bottle very easily,” said Nielson. “I can feel awkward and regretful about that.”

Yet, he thinks the efficiency the Internet created has a “net positive effect.”

“It’s enormously powerful and pervasive and good,” he said. “That doesn’t mean it’s perfect by any means.”

“The main thing to appreciate is, the Internet is only 40 years old,” Bennett said. “It’s got a lot of life left in it. We’ve seen some pretty good hints of what it’s capable of. We should prepare to be amazed.”

Jessica Floum is a San Francisco Chronicle staff writer. Email: Twitter: @jfloum