Yep, the hose vents the heat and at least some of the condensation.
Not in a window? Sounds like Fry's. Something they forgot to teach about heat exchange.
You could arrange a box around the rear and maybe a couple dryer hoses with a fan to vent the heat, but it'd be a foul looking beast.
When I was renting in CA I had a couple narrow units that fit in 21" or so. Use a tape to check the actual cabinet size, without the accordian baffles. That buys 1.5-3".