In Massachusetts, a young woman makes genetically modified E. coli in a closet she converted into a home lab. A part-time DJ in Berkeley, Calif., works in his attic to cultivate viruses extracted from sewage. In Seattle, a grad-school dropout wants to breed algae in a personal biology lab.

These hobbyists represent a growing strain of geekdom known as biohacking, in which do-it-yourselfers tinker with the building blocks of life in the comfort of their own homes. Some of them buy DNA online, then fiddle with it in hopes of...