Most Londoners will know someone suffering from the extortionate expense of finding a place to live. For those trapped in the rental market, the outlook is particularly bleak. In 2011 the Resolution Foundation reported that the price of securing a tenancy can be over £2,000 in upfront costs, while other figures have shown that one in three tenants now spend half their takehome pay on rent. As more and more areas of London become unaffordable to anyone but wealthy professionals, where will essential workers go to live: the people who clean the streets, and cook the food and keep the city ticking over? They can stay at home with relatives, or sublet from people with existing tenancies, but some do not have these options. When I found myself in this position, I went to the only place I could: the slums of the Thames.

To call the vessels here houseboats would be generous; though waterborne, two of the three had no engine, nor their original shapes, the structures having been ripped out and rebuilt upon the base. A more accurate description would be floating shacks; timber huts erected on decrepit old grain barges on the river in west London. Between them, these three shacks house on average 20 people, the numbers only falling in a harsh winter, when some can no longer stand the conditions. Nestled in the trees, by a row of other boats, they have been moored on public land by the Thames for well over a year now, having moved downstream when another Greater London council drove them out. The usual dog walkers and running groups pass by, mostly oblivious to the slum in their midst, unable to countenance that it could exist in this wealthy borough of one of the richest cities on Earth.

A report last year for the London Assembly said the city's waterways are the permanent or winter home of at least 4,000 to 5,000 residential boats, and 10,000 people. Some of the boats offer luxury short-term stays. Comfortable rooms appear on flatshare websites from time to time, at typical rents of £600 a month in areas such as Richmond. Other renting is likely to be entirely informal and reliant on word of mouth. It's impossible to say how many people are living in conditions as desperate as those I experienced.

A cramped cabin with a plywood bed. Photograph: Sam Forbes

My own life in the slum began in February last year when I moved to the area for a job in a restaurant kitchen. I scoured the listings for options within my price range; there was one. A day later I met the boat manager, an ex-army man in his late 20s who lived on his own, far nicer, boat next door. Like many who are first shown round, I was taken aback by the rooms on offer. Most of the cabins have 15mm-thick MDF walls, and are built to hold a mattress and little else, with as many squeezed on as possible. Dampness permeates everything, not helped by the old carpet used as makeshift insulation on the exterior walls, which quickly accrues mould. The smokeless fuel used in the stove below deck taints everything with its residue. Everywhere you tread, nails and screws stick out to catch your skin and cut wires trail across surfaces.

The first room offered to me was deep in the hull of the boat, far away from the central living space and the stove. It was the only room with a hatch opening straight to the outdoors, through which water dripped during heavy rain; it had been abandoned by its previous occupant because of the cold. There was one feeble working LED bulb and I had to stoop at all times; the ceiling was 4ft 11in high. Mould had spread across the underside of the mattress lying on the plywood bench that served as a bed. I requested another room and was offered one on the next boat for a two-night trial period. It was still small, but clean and tidy and most importantly dry. After searching in vain for an alternative place to stay, I realised I had no choice but to move in.

The room I chose had a smashed window and was open to the elements, meaning I could see my breath when I was in bed (March 2013 was to prove one of the coldest on record). The only upside was that the draft offset the fumes from the stove, lessening the dread caused by the occasional sounding of the carbon monoxide alarm. Better to be cold, I reasoned, and wake up the next day.

Living conditions on the barge: around 20 people share three shacks. Photograph: Sam Forbes

Although lights were available round the clock, sockets could only be used for three hours every evening when the generator was on. There were no showers; all washing had to be done at a local gym, which if nothing else, encouraged a healthy fitness regime. There was one chemical toilet on each boat, emptied sporadically into holes in local woodland, but the poor standards of hygiene meant that in practice everyone used toilets elsewhere: a 20-minute round trip. For these luxuries I began paying £230 a month, but crucially, no agency fees and no deposit. When I became weary of the cold on that boat, I took a chance to move next door. The new room was almost entirely filled by a single mattress, with a few square feet of floor space and some shelves. Though this boat was warmer, it leaked during heavy rainfall, containers filling up in the living area and drips coming through to the electrics. I had upped my rent to £280 a month for a room 6ft 9in tall, 4ft wide and 9ft 5in long.

This way of life inevitably attracts colourful characters. A few longer-term residents, some of whom had been on the boat for years, genuinely enjoyed the life of the river. They had pets, and were often heavy drinkers, chain smokers and drug users, partying until the early hours. The boats meant freedom from rules and regulations, and form-filling officialdom. Most residents bought bottled water rather than consume the drinking water that was filtered straight from the river, but one man told me it didn't bother him because he never drank water; his entire liquid intake came in a cider bottle. He once advised me to cover my food in the kitchen; not because of rats – they were dead – but because they had stuffed the ceiling full of poison and had no idea where it might fall out. Included in this group were some of the younger crowd on my boat, people who liked the communal living, sitting out on the deck in the summer with a barbecue and some beers. It was enough for them to forget the conditions. Some of them admitted that they could afford to live elsewhere. They worked full-time; one designed computer games; another was a football coach; one young woman worked for a local council. They had no plans to stay in the long term, but were saving money by tolerating the boats.

Then there was the second group, the people with insecure, often part-time work, without roots or contacts in the capital. They came from all over the UK and the world to work and study: a German student, a Dutch woman jobhunting, a builder from Norwich. There was a steady stream of prospective tenants desperate to live in London but without the wherewithal to secure good quality accommodation. Some turned their noses up after a quick tour of the facilities and were never seen again, but many came back, sometimes only for days or weeks until work dried up or they were fortunate enough to sublet off others. An Italian man, who worked in a pub in Fulham, moved in from a squat with his dog and was given the coldest room on the boat to do up as he pleased. After only a couple of weeks he decided to leave and go back to the squat instead.

The residents of each boat share one chemical toilet. Photograph: Sam Forbes

Many of this group were the last people you would imagine finding there: a teenage girl who worked at John Lewis; an 18-year-old Essex boy who was an apprentice chef in Chessington World of Adventures. In an ideal world they would want an en-suite, with enough sockets for a hairdryer, straighteners, dryer and a flat-screen TV. Instead they found themselves in a damp, tiny room with electricity for three hours a day. There was only one reason these people were there: money. For their rooms they paid up to £360 a month, but mostly in the mid-£200s. There were no bills, but there were no services either; it was all off-grid.

How can someone charge £360 a month in a dwelling without running water, central heating or adequate sanitation facilities? Because the crippling costs of renting in London mean many people simply cannot raise enough money to secure decent accommodation.

I've often heard people ask how anyone can afford to live in London on low paid, insecure work. The truth is that some don't really live at all; they merely exist, and their existence is bleak and unforgiving. It is not only the explicit dangers of the boats that cause this but the drudgery of daily life. Everything takes longer, and requires more work to do: fetching water from a mile downstream, lugging your clothes two miles to the launderette, boiling kettles to wash up and buying perishables every day because you have no refrigerator. You're always cold in the winter and rarely completely clean. Basic survival becomes exhausting.

My departure from the boats came only two and a half months after I moved in. A safety inspection failed my boat on six counts and with "significant faults found which put the occupants at risk and in immediate danger". Of course, I already knew this: it had been staring me in the face since I arrived, but to see it written down in such explicit terms drove me to the exit. The others either didn't care or didn't have the means to do anything about it.

'There were no bills. There were no services either.' Photograph: Sam Forbes

Round about the same time the local council, acting entirely independently of the Boat Safety Scheme, issued eviction notices on the boats, as well as scores of others on the same stretch of land. The landlord's reaction was to shrug it off; "we're going nowhere," he said. Apparently they had tried these scare tactics before but had never followed through with any action. Sure enough, seven months later the boats are still there. Even if the authorities eventually clamp down and move him on, he can simply relocate to another borough, where they'll take another few years to get on the case.

The reaction of local residents to the eviction notices was typical and perhaps understandable. The usual complains arose about rubbish and pollution and "water Gypsies" who don't respect their surroundings. Many of these grievances may well be legitimate, but they also reflect a denial of the real issue: that while the boats can be moved on, the housing crisis isn't going anywhere. The growth of the "scrapyard", as one local called it, is driven not by choice, but by a lack of it.

Many of these well-heeled locals will have eaten at the restaurants that fill this part of London; perhaps Jamie's Italian on a Saturday night. If the person who called for the boats to be forced away, branding them an "absolute disgrace", had gone into the kitchen there and spoken to the staff preparing his food, he might have found the man living in the cabin opposite mine. He had travelled hundreds of miles in search of a job, and worked as hard and as often as he could. Long after all the diners had left, he trudged to sleep in a freezing bed, just to get up the next day and do the same thing. He didn't want to live there, but in London he had no place else to go.