Image copyright Birmingham City University Image caption The Custard Factory hive in Birmingham is home to 50,000 urban bees

Saving the planet, protecting the bee population or just an excuse to harvest your own honey. Why are so many people taking up urban beekeeping?

It's happening in back gardens, on rooftops and in fields up and down the country.

Your friends may be doing it. Your neighbours could even be at it too. But just what is it that is so attractive about beekeeping in towns and cities - and why now?

Normally associated with the countryside, beekeeping in built-up areas has boomed in popularity over the past nine years, according to Tim Lovett, of the British Beekeepers Association (BBKA).

The association's membership has risen from about 8,500 people in 2008 to more than 24,000 - many of whom live and keep bees in towns and cities.

This huge increase has its roots in fears a decade ago that the world's bee population was under threat. Dramatic and unexplained colony losses in the United States prompted a publicity campaign in this country urging people to do their bit - and the result is hives across suburban gardens and yards all over the country.

"There was a renaissance in the interest in beekeeping and it just so happened that people interested happened to be in towns," said Mr Lovett.

In Birmingham, the rooftop of the city's Custard Factory building, in Digbeth, is home to 50,000 urban bees.

Image copyright Birmingham City University Image caption Mr Vivian said Custard Factory bosses and tenants have been supportive of the initiative

Image copyright Google Image caption The wildlife in Digbeth has proved to the bees' advantage

The former industrial area is a far cry from the bee's traditional habitat. However, this is actually to the bees' advantage.

Tim Vivian installed the hive when his employer moved to new offices there.

"Mankind doing nothing is often the best thing for wildlife, and bees," he said.

"When a building is demolished, or just becomes derelict, nature rushes in. One of the first plants to appear is rosebay willowherb which the bees love. After that, woody plants like bramble and buddleia appear.

"Another great thing about urban areas is that the plants are unlikely to be treated with pesticides. In the countryside a lot of the forage is from farmed crops which have all sorts of treatments and sprays."

Mr Vivian, who already kept bees in Worcestershire, said the Birmingham honey crop was lighter than the "very dark" rural honey he produced. This is a result of the different plant variety's the insects fed on in the city.

Image copyright Thinkstock Image caption Despite urban beekeeping being relatively new, thousands of people are taking part in the pastime

In London, Urban Bees was set up about a decade ago to install and maintains hives in the capital. It also runs courses teaching people about bees and helps to engage people in making cities more bee-friendly.

Its popularity has seen hives springing up in a number of unusual locations, including hotels and embassies.

Co-founder Alison Benjamin believes city-dwellers are suffering from "nature deficit disorder".

"Keeping bees reconnects you with nature - the seasons, the weather the flower, the trees - which all bees are so dependent on," she said.

"People want to eat locally produced raw honey straight out of their hive that saves on air miles and may cure their hay fever."

Tips for budding beekeepers

Image copyright Thinkstock Image caption People interested in urban beekeeping are encouarged to be considerate of their neighbours when siting their beehives

Join a local beekeeping association and go on a course during the winter (for theory) and summer (for hands on), or find an experienced beekeeper that you can shadow

Make sure the proposed location for your hive is in a place that you could open once a week at midday without bothering any neighbours

Make sure you've got easy access to a hive. Up a makeshift ladder to a roof isn't a good idea when you're carrying down heavy boxes of honey from your hive

Make sure you've got somewhere to store all the equipment and woodwork for the hive

Buddy up with a friend or would-be beekeeper to learn together and share the responsibility

Source: Alison Benjamin, co-founder of Urban Bees and co-author of Bees in the City: the urban beekeepers' handbook

But with tens of thousands of bees swarming around urban environments, what are the safety considerations?

There is, of course, the risk of being stung and the general nuisance swarms of bees can pose to neighbours.

Above all, you must be a responsible, considerate neighbour, says Mr Lovett.

Putting hedges, fence panels and netting around bees is a good way of encouraging them above head height, he said.

"There are risks of being stung, but given that bees will fly up to three miles to forage, it's a matter of 'whose bee was it?'," he adds.

"Urban beekeeping is a very valuable pursuit, but it has some special considerations about siting of hives, of looking after bees and looking after your neighbours," he added.

And what for the future?

Mr Lovett said he hoped a boost in the positive image of bees would encourage people to continue keeping them.

"Before we campaigned, the PR profile of bees was they sting, they produce honey - but so what - and they swarm which can be a nuisance," he said.

"But today it's [that] they are very important pollinators, yes, they produce honey, of course they will sting if they have to defend themselves and swarming is doing the right thing - it shows they are vibrant and their population is growing.

"There's been a very positive makeover in their profile with the public, so I think members will stay."