The good news is that I will never be home alone again. The bad news – well, it’s not in fact bad news, but it is slightly unsettling – is that I share my home with at least 5,000 other species: wasps, flies, spiders, silverfish and an exotic bunch of wild bacteria.

All that information is apparently contained in a patch of grey dust I have just swabbed with my right index finger from a door frame in my living room. It’s like a DNA test of my house, says Rob Dunn, a 43-year-old American biologist who has come to my house in Copenhagen to hunt microbial life. He carries no lab gear and his blue crewneck jumper and striped Oxford shirt are hardly the combat suit of an exterminator. But with every discovery we make, with every spider we find lurking in the corner or each swab of dust, he displays an almost childlike sense of excitement. He swears and smiles, even whoops with delight: “This dust sample contains bacteria, your body microbes, your wife’s body microbes, your child’s body microbes. If you smoke weed we would find marijuana DNA in there. Everything is visible, but it’s also present in every breath. Every time you inhale, you inhale that story of your home.”

Dunn is to house insects and indoor bacteria what Marie Kondo is to neatly folded shirts. He wants us to study the wildlife in our homes and realise that what we discover should spark much more joy than fear. When he began working as a biologist he went to the jungle to study wild beasts, but now his research is dedicated to species much closer to home: to the flies, spiders and bacteria hidden in every nook and cranny of our kitchens, bathrooms and basements. To the “jungle of everyday life”, as he describes it in his new book.

It’s a jungle in there ... Rob Dunn (left) explores Lars Eriksen’s home in Copenhagen. Photograph: Marie Hald/The Guardian

Never Home Alone tracks how we have been disconnected from the ecosystems of our homes. It’s a book of hard truths – I now know that I shed 50m flakes of skin every day, providing food for thousands of bacteria, and that cockroaches are basically our perfect interspecies Tinder-match. It also confronts our irrational relationship with cleanliness. Our modern instinct might be to swat a spider on the kitchen worktop or blitz creepy crawlies into oblivion with antimicrobial sprays, but we could be killing useful allies, according to Dunn: “The key thing is that your life is going to be full of life. And your only choice is which life. Our default is that we try to kill everything and fill our houses with stuff that’s totally terrible for us. We might kill 99%, but that leaves 1% – and that 1% is never the good stuff.”

Dunn is in Copenhagen for work and has agreed to come to my home to go through dusty corners and spider webs to point out where I might find some of the 5,000 species I bunk with. I suspect our 110-year-old house, shared with another family, is a fertile hunting ground, and Dunn seems optimistic. Using a screwdriver and tweezers, he pokes at light fittings and sifts through the basement, which can be a mould-friendly hangout during sticky, wet summers.

While I’m making coffee, Dunn lets out a yelp: “Oh yes, this is good!” He has spotted a globe-shaped lamp hanging in the basement hallway, and in the bottom of the hazy glass cover is a Pollockesque pattern of dead wildlife. He tips the contents of the lamp on to a fold-out table and uses the tweezers to organise the harvest: two types of fly, a wasp, a meal moth, some aphids and various planthoppers. He takes a closer look at two of the dead flies: “I can tell they are likely to be the same species, but I don’t know for sure until I look at their genitals.”

He turns to the silver-shiny meal moth. “Isn’t it just beautiful? It moved in with humans in ancient Egypt and has moved with humans again and again.”

But how would it have ended up in our home?

“This meal moth could have come in with grains.”

Like from a box of cereal?

“Yes!”

‘You could start a sourdough loaf with this’ ... leakage from the water heating system. Photograph: Marie Hald/The Guardian

Dunn wants us to see our homes the way we see our gardens. There are pests and pathogens we need to control – those that make us sick – but we also want to preserve diversity. He says fewer than 100 species of bacteria, protists and viruses cause nearly all infectious diseases today. We try to keep these in check with vaccinations and antibiotics, and by washing our hands. But that leaves us with a jungle of tens of thousands of other species, many of which we know little about, but which Dunn’s work suggests can often be more beneficial than harmful. For example, studies have shown that a higher diversity of bacteria on people’s skin – bacteria linked to soil and plants – can reduce the risk of allergies. He also mentions the discovery of a bug that could be a new source of useful enzymes: by testing the microbes in the gut of the camel cricket, found in many American homes, Dunn’s research team discovered bacteria that were able to break down industrial waste and turn it into energy. Making “cool discoveries” like this and enlisting the public to sieve through their homes for wildlife has spurred interest in a field he says has been neglected for too long.

“The first drawings of microscopic life are all of household species,” says Dunn, “but once we figured out the germ theory of disease it shifted, and both scientists and the public started to think that what was indoors belonged to pest control. Ecologists went to the Galapagos, we went to the rainforest, but it pushed us away from the home and it left us with this huge blind spot.”

‘That’s a lovely spider web’ ... Dunn explores the basement. Photograph: Marie Hald/The Guardian

Dunn grew up in rural Michigan, hunting snakes and turtles, building tree forts and being “more curious about nature than your average child”. Today, he is a professor in the department of biological sciences at North Carolina State University, where he has spent the past decade involving his colleagues and the public in studying the microbial landscape of our bodies and our homes. Part of the thrill of his new book is the sense of discovery and engagement with the world outside the lab. We head deeper into the basement, to the water-heating system, where one of the pipes has a leak; water drips into a chalk-crusted yellow bowl. Dunn grabs the bowl and tips it on to its side so we can see the puddle: “You could start a sourdough loaf with this.” The water heater is an example, he says, of the extreme conditions we create in our houses. These specific ones are similar to what you might find in an Icelandic geyser, which means that our basement heating system now attracts bacteria that would normally thrive in volcanic hot springs. He moves on to a sprawling mess on the wall next to the boiler. “That’s a lovely spider web,” he says excitedly. I feel a strange sense of pride and relief that my lack of cleaning is potentially boosting the ecosystem I inhabit. “This kind of spider is super-common in houses and can live for many, many years. This can grow up with your kid.”

I’m not sure I’m ready for an in-house pet spider, but while our natural inclination might be to shriek or stamp them out, Dunn wants us to protect them. “The natural enemies of the pests in our homes are very often, whether you like it or not, spiders,” he writes in Never Home Alone: “If you kill the spiders in your home (and this is precisely what we do with many kinds of pesticide applications), you do so at your own expense.”

The curse of pesticides brings us to the bathroom and another key area of his research: shower heads. Dunn and his team asked people from across the US and Europe to send in swabs from their shower heads. And within the biofilm – “a fancy word for the gunk” that builds up inside them – they discovered a pathogen, nontuberculous mycobacteria (NTM), that is linked to lung disease in people with weak immune systems. What they didn’t know was why this pathogen seemed more prevalent in some regions than others. “There was more of the NTM in the US and in particular in chlorinated water,” says Dunn. They came to the conclusion that “residual chlorine kills all the competing bacteria and just leaves the NTM, which are chlorine-intolerant.” And when the competition is eliminated, the pathogens thrive.

He unscrews the shower head from the hose and runs his finger along the rubber fitting. There is very little biofilm-gunk, which he credits to the quality of the local water supply. “Most of Copenhagen still has untreated groundwater that relies on the wild biodiversity of crustaceans and bacteria to clean it. But if you break that – like we do in the US – it’s super-expensive to fix it and it sucks. And it makes you sick.”

Shower heads tend to produce biofilm – AKA gunk – says Dunn. Photograph: Marie Hald/The Guardian

Crustaceans? “Yes, in some cases you can encounter small crustaceans in the tap water here. Denmark tastes like biodiversity.”

We continue through the living room and kitchen. He pulls a book from the shelf to test for book lice, and picks up a log of firewood that has a spidery, grey pattern of reindeer lichen growing on the bark. In the kitchen he checks the dishwasher soaptray for a particular form of bacteria that is otherwise only found “in the faeces of tropical fruit bats”. Even our salt jar is apparently full of life: “Almost every crystal of salt has bacteria inside, and when you brine something in salt, those bacteria contribute to the flavours of the brine. The longer it sits in the brine, the more the microbes in the brine are going to contribute to it. Isn’t that cool?”

Food is an area where Dunn has found the influence of microbes and bacteria to be more palatable to people he meets. Food is alive – whether it’s sourdough bread, kimchi or beer – and we are cool with that. Much more so than with the spider crawling across our windowsill. Dunn describes a study of how specific microbes found on bakers’ skin influence sourdough starters and the flavour of bread. His team gathered 15 bakers at a facility in Belgium and tasked each of them with making sourdough starters from identical ingredients. When they tested the bakers’ hands afterwards, it showed a close relationship between the microbial makeup of each starter and the bacteria found on the skin of the baker who made it. In his book Dunn describes how the bakers and biologists, drunk on spontaneously fermented Belgian beer, tucked into the breads and broke into an impromptu toast: “‘To bread, and to microbes!’ And to a house in which both are delicious. ‘To bread and to microbes!’ And houses in which we are all healthy. ‘To bread and to microbes!’ And to lives filled with wild species we have yet to study or understand, species that float like mysteries all around us and offer services we are only beginning to measure.”

Checking for book lice. Photograph: Marie Hald/The Guardian

Our house tour and inspection has come to an end. I’m curious about the professor’s verdict. Is this a happy, fungi-rich, insect-thriving home? “You have a lot of species that I think of as being part of a healthy house,” Dunn says. “To me, your house is rich in biodiversity and seems dominated by those things that you either shouldn’t worry about, or that are beneficial. Also, I don’t see antimicrobial products all over the place.”

He points to the leftovers of a coffee kombucha-glazed Danish pastry we were eating earlier. “And then you have things that spark joy for you: fermented pastries, salt that’s alive and healthy water from Denmark that we know is alive.”

Whether we like it or not, the species living in our homes are a measure of our lives, says Dunn, and his biggest fear is that we risk killing off that biodiversity. “If spiders scare the hell out of you, but you are willing to have one living in the corner, and maybe approach it sometimes to keep an eye on it, then that’s great. That’s much better than if your response is to jump away from it and spray pesticides all over your home, because that will only favour species that cause us harm and are resistant to pesticides. But it’s not easy. This book won’t solve [the problem], but maybe it will open some new conversations.”

As he says goodbye and walks down the garden path, I spot a tiny moth in our living room, flapping frantically in the corner. I don’t freak out or necessarily feel any great joy, but I leave the moth be. After all, there are 5,000 of us here, and you need to give your housemates some privacy.

• Never Home Alone by Rob Dunn is published in the UK by Basic Books (£22.99) on 14 March.