Consider sleeping outside in New York City, and the first thing that comes to mind probably isn’t the glory of the great outdoors. More like the trials of homelessness.

But there’s bona fide camping to be done within city limits, news that would no doubt surprise Manhattanites for whom the wilderness is a sidewalk cafe and roughing it means bedsheets with a low thread count.

Last year, the National Park Service created the city’s first full-fledged campground out at Floyd Bennett Field, a decommissioned airfield that sits aside Jamaica Bay at Brooklyn’s southeast corner. In May of last year, it opened 36 new campsites at the field; this month, it also introduced seven campsites at Fort Wadsworth in Staten Island. The sites are the first urban campgrounds created by the Park Service and a model it hopes to duplicate elsewhere.

Intrigued, I recruited my son Leo, 12, for an expedition. Following the instructions on the Park Service Web site, I reserved a campsite at recreation.gov. The site offers thumbnail shots of each plot, though they reveal no glaring differences — I picked the one that seemed most remote, paying the $20 fee with a credit card.

Then I set about getting ready. Now might be a good time to mention that as a longtime New Yorker raised in suburban Connecticut, I’m not exactly Paul Bunyan when it comes to outdoor skills. Drop me in a forest with a compass and a pocketknife, and there’ll be coyotes snacking on my bones within days. Hours, maybe. So I had to do some thinking about what exactly one brings on a camping trip.

A tent purchase was in order, for starters. Sleeping bags. Bug repellent. A flashlight. Matches. Some food packed in a cooler and marshmallows to roast.

Those were no-brainers, but there were details to consider. Did we need a pad to sleep on? What about pillows — do real campers bring those, or would they make us the laughingstock of the campground? I’ve got neck crinks to consider, dammit.

I end up ditching the pillows, but the other stuff added up, and by the time we finally make it out the door, the bulk and weight of our duffel bag seem faintly ridiculous. Instead of a rugged outdoorsman I feel like Zsa Zsa Gabor’s valet.

Our destination may well be the only camping site in America reachable by public transportation. We take the 2 train to the last stop in Brooklyn, then board the Q35 bus. As we make our way down Flatbush Avenue, past landmarks of natural beauty that include a Midas shop and the Kings Plaza Mall, this is seeming an unlikely mission.

Eventually the landscape opens up, though, and after crossing the Belt Parkway we see the Floyd Bennett Field visitor center on our left, and hop off.

We’re late for registration, which ends at 4 p.m., but a lingering park ranger gives us a map and points us to our site. It sits at the end of an old runway that’s some three-quarters of a mile long — a formidable hike for someone lugging a bag the size of a steamer trunk. (Luckily Christian Johnston, the Post photographer, arrives and gives us a lift.)

At the end of the runway there’s a spot for parking; across from that is a path leading into a wooded area. We follow it and find a winding trail leading to clusters of campsites, some 28 in all. (There are a handful of others in a nearby area, as well as a half-dozen RV sites.) Each campsite has a picnic table, a campfire ring and a standing grill.

If each were filled, the result wouldn’t exactly be “Into Thin Air”-style isolation. Most are empty, though, and ours lies in a nook that’s otherwise uninhabited. This is typical for midweek, I learn — on weekends the sites fill up. For now, our main companions are mosquitoes — there are plenty of those, and I’m grateful for the bug repellent.

Leo and I set about pitching our tent, following the printed instructions. We wouldn’t win any merit badges for speed, but before long it’s up, our sleeping bags are unrolled and we’ve carried in a supply of firewood from a pile that conveniently sits by the campground entrance.

A Park Service brochure had alerted me to fishing nearby, and the chance to go native and catch a wild dinner holds a strong lure. So we walk across a large parking lot, past a massive old hangar full of broken windows, to the edge of Jamaica Bay, where a few fishermen are trying their luck. (There’s also a launch where you can put a canoe or a kayak into the water.) Using rods brought by our trusty photographer, we bait up and do some casting.

I’d love to say we pulled in a big, grill-ready striper, but the truth is we got nothing so much as a nibble before the sun started sinking and it was time to think about dinner. On the way back, we pay a visit to the one other active campsite. (Three others have tents pitched, but no signs of life.)

There we find Alex Khalap, an affable Russian who offers a beer and one of the crepes he’s cooking on a pan nestled in his campfire. A ex-Sheepshead Bay resident, who’s driving a cab while applying to grad school, he’d been rendered homeless after breaking up with his girlfriend. Having camped previously at the site, which he said is popular among the area’s Russian community, he’d decided a tent would be the perfect crash pad while he looked for a new place to live. So he arrived on his motorcycle along with a female companion, Lauren Councill, whose presence, along with the crepes, the pint of brandy on the picnic table and Khalap’s easy manner all spoke of a man who’d landed firmly on his feet.

“I like it here, and the price is right,” he says, rolling a cigarette. There are interesting people to meet, he says, and on the weekends [there are] Russians “drinking it up and making shish kebab.”

It’s getting dark by the time I tend to our own dinner — chicken sausages and pirogi. As I build a fire and set about cooking, I’m taught a lesson that will be useful next time out: In the woods, it’s a lot easier to navigate when the sun is out. Bumbling around in the dark with smoke in your eyes and a flashlight in your teeth is no way to whip up a gourmet feast. Eventually I manage it, though, and it tastes awfully good, eaten around the fire and capped off by toasted marshmallows.

It’s late by the time we hit the tent. Leo’s out quickly, and I expect to follow. But it takes awhile. Planes from JFK roar regularly overhead, and the sound of cars on far-off Flatbush Avenue is surprisingly loud.

Then there are the other scattered sounds of the woods, which start to loom larger as I lie awake. Like that crackling branch. Someone approaching? This is an unfortunate time to remember a recent Post story about a Russian guy in Sheepshead Bay who fed his roommate through a meat grinder, but remember it I do. Wonder if that guy liked to camp . . . And then: Bam!

Hard to ignore that, so with an uneasy hand I unzip the tent flap, and shine the flashlight into the red eyes of a raccoon, who’s knocked our cooler off the picnic table. He doesn’t look big enough to unzip a tent flap and feed us through a meat grinder, so I settle back down, and soon I’m asleep.

When I wake seven hours later, two thoughts come to mind. I consider how cool it is to wake up in a tent in the woods, removed from the bustle of urban life. And I wonder how far it is to the nearest chiropractor. Turns out that arch in the ground that didn’t seem a big deal last night loomed larger over seven hours.

I shake it off, though, and we find a beautiful day outside. We also find another set of neighbors, who are packing to leave — a family helmed by Nancy Shuman of Brevard, N.C. They’d spent three nights here, traveling into Manhattan during the days to see the sights.

Amazed at being able to stay within city limits for $20 a night, Shuman was well pleased with the setup — and, she noted, “we’ve pretty much had it to ourselves.”

Following another tip on the Park Service brochure, our plan is to rent bikes at Aviator Sports, a facility with ice rinks, a climbing wall and other diversions. It seems like a great way to check out the area. But the guy at the counter, sitting by a flier that prominently boasts “BIKE RENTALS” says the bikes “haven’t been taken out of storage yet.”

An annoyance, but we take a walk and visit the field’s fabulous community garden, a large expanse where hundreds of members grow vegetables in carefully tended plots. Then we stow our bag at the visitor center — “You brought that bag camping?” asks one ranger — and hop the bus for a few hours on the beach at nearby Jacob Riis Park.

Another bus and a train ride later, and by day’s end we’re back home in Park Slope. A great getaway, we agreed — and all done with $20 and a MetroCard. We’re already making plans to do it again — though next time, we’re traveling lighter.

The Wild Side of Life

Naturephobic first-timers can have some misconceptions about the potential hazards that await the camper, says John Warren, spokesman for the Gateway National Recreation Area, the large, noncontiguous national park that includes Floyd Bennett Field.

“Some people are afraid of bears coming into their tent — that’s not gonna happen in Brooklyn,” he says — though you will find some rabbits and “a good variety of bird life.”

The one critter you do need to be wary of is the raccoon, who wants your food and is resourceful about getting it.

“They’ve got opposable thumbs,” says Warren. “Leave food where it can easily be accessed, and they’re going to get in there and get it.”

So keep it in your vehicle if you’ve got one, or in your tent.

Speaking of predators, theft isn’t common, but it’s not unheard of either, so “use the same common sense you use when on vacation, and don’t leave things of any value in sight.”

Anything other tips?

“Bring a lot of pairs of socks,” he says. “Dry socks are always nice to have.”

The Ins and Outs

To score a campground at Floyd Bennett Field — or at the Park Service’s new campsites at Fort Wadsworth on Staten Island — reserve it online at recreation.gov. The fee is $20 a night, paid upfront, with a maximum of six people per site.

Activities out at Floyd include fishing, birding, canoeing and kayaking (bring your own craft) — and even archery. (Note to Ted Nugent: no crossbows.) Aviator Sports, a private business in an old hangar, usually offers bike rentals, but its cycles are being repaired, so call ahead: 718-758-7500.

For aviation buffs interested in the history of Floyd Bennett Field — which was the city’s first airport, opened in 1931, and then a Naval air station during WWII — there are exhibits and old newsreels in the new Ryan Visitor Center in the airfield’s former terminal. And on Tuesdays, Thursdays and Saturdays, a dozen restored historic aircraft are on display at Hangar B.

If you want to learn the camping ropes from a pro, the Gateway park rangers offer a kind of overnight tutorial — “Family Camping in the Urban Outback.”

They’ll show you fire safety, how to set up a tent, “cook out like a pioneer,” make s’mores and offer other pointers. You’ll also kayak and hike. Check-in time is 2 p.m. on Saturday; it’s over at noon on Sunday. In addition to this weekend, there are sessions Aug. 18-19 and 25-26, Sept. 8-9 and 22-23, and Oct. 13-14. It’s free, but you need to reserve a space; call 718-338-4306.