Behind the white clapboard house in prime Edgartown real estate, around the back fence — high steel fencing, covered in turf and topped with razor wire — a patch of grass has been turned over to a garden. Like other gardens in the neighborhood it is dormant and frozen over now, but soon it will be carefully tended by a crew who will pull its weeds, plant and harvest its vegetables, more than willingly and for no pay. Indeed, each man must earn his time there.

Richard, a big man with a broad smile, confesses he likes the eating more than the gardening. “All that bending down and back up,” he says, adding a crack about middle age. He talks about the taste of fresh tomatoes while conducting a tour of the Farm Institute, where he and other inmates at the Dukes County Jail and House of Correction honed their gardening skills.

“I thought, you know, the more fertilizer that you put in the ground, you know, the better it would grow, but you have to aerate, you know, otherwise it rots — like what happened with our onions,” Richard explained.

Richard prefers carpentry and handyman work, other skills he polished at the farm. He’s here on a work-release program, and today the farm staff will host a lunch in his honor because tomorrow he will be free on parole.

“I’ll be coming back to help,” he grins over a buffet of chicken, tur-duck-en soup and baked butternut squash. He already has some work lined up with a friend who is a contractor, but he has come to love the farm and will volunteer again.

He arrived at the farm in the morning when an officer dropped him off, and in the evening he will return for his final night in a cell, in that historic house which now features such out-of-period features as state-of-the-art locks on every door.

The security is not the only state-of-the-art part of this facility, however. The jail’s community garden and its work collaboration with the Farm Institute are part of an astonishingly broad educational department, all run by a no-nonsense woman from a small room, past the picket fence, through the alarmed double doors, up the wide old wooden staircase and past another set of locks.

Katy Upson goes through a starting list of her programs: “The SCORE people [employment counselors] come in, we have a fathers’ group, a book club, we have ... the GED [high school graduate equivalency diploma] program, we have a link-up with three community colleges that provide classes online into the jail — there’s just a lot going on.”

Free on parole, Richard will work carpentry but volunteer on the farm. — Jaxon White

There is also yoga, substance abuse and anger management, health education, vocational training, computer and culinary arts classes.

None of it is mandatory for inmates, but they get time off their sentence for useful work or study. The jail’s capacity is 33, she says, but occupancy is usually about 25, with some inmates there for a few months and others two to three years. Most are Islanders, or people who committed their crime on the Island. Some programs, off the site, are reserved for hand-picked inmates depending on security risks.

“But anybody can come in here,” says Ms. Upson, seated under a whiteboard that charts the schedules for online courses inmates are taking. They use the two computers resting behind her; no more than two men at a time, and she supervises their work at the screens in her spare office-cum-classroom, decorated with photos of inmates receiving certificates. One man now is studying through Holyoke, one with Springfield Tech and another at Cape Cod Community College.

In addition to college-level courses, the jail offers online vocational courses such as web design or other computer studies. “These are six-week courses, so for someone who is here short-term, it’s perfect,” says Ms. Upson. “They do have to pay for them, which they don’t like. The ones that go to college often can get financial aid, but that takes about four months.,” she says. “I had one fellow who wrote a novel; he took four or five creative writing courses.”

Near the computers are several copies of The Old Man and the Sea, the latest selection for the book club she runs in the jail. “They loved that one,” she says. Other favorites have been The Perfect Storm, Forest Gump and Water for Elephants.

Children’s books, too, are stacked on a shelf above the computers. Those are for the Read To My Child program. “That’s where the fathers come in — or grandfathers, brothers, whatever — and they will pick out a bunch of books here, and then I’ll video them reading to their child,” Ms. Upson explains. “Then they can send one of the books home. So we mail the book home with the video, or if they have a visit, if the child comes to the jail, they can give them the book at that time. And the kids really love it. We’ve had many of the dads do more than one.”

It is a set part of the eight-week fathers’ program she runs twice a year with Peter Huntington.

“Peter talks a lot about how you talk to your children about being in jail,” Ms. Upson says. “A lot of guys don’t want to even mention it, so that’s very touchy. So we rehearse it sometimes, and then when they get a phone call or something they have a little bit of a script that they can use to kind of get them through . . . because a lot of the kids are angry that their father isn’t there, and fathers feel very ashamed, but both of those things don’t help the relationship.

“A lot of the fathers say, ‘Well, I’ll never see my kids again, their mother doesn’t want me to see them.’ But Peter will emphasize that you have to keep trying. Even if the letters are returned you have to keep trying because some day that person is going to look you up,” she says, envisioning the returned letters stored in a drawer.

Ms. Upson came to the Dukes County jail three years ago; she has worked for the sheriff 10 years, previously part-time teaching GED at Community Corrections. GED is still a major part of her program. “We really push very hard to get them through their GED, because without that they can’t do anything. You can’t even work at the Stop & Shop without a high school diploma,” she says.

She says the Farm Institute collaboration brings together many aspects of what her education department is trying to do. “That opened up a lot of opportunities for the inmates. First, to go to work at the farm, to begin to understand about working, and secondly about organic gardening, and that’s how the [jail’s community] garden began.”

The Farm Institute jobs offered carpentry skills which can be used toward a ServSafe or OSHA 10-hour Construction certificate.

“We hand-pick the inmates,” she says. “They usually indicate they want to go and then if we think they are going to be successful out there, we’ll let them go with an officer. We usually don’t send more than four, so they are under supervision.

“It gives them a chance to feel that they are helping somebody, yes, but also they feel that their job is a job that’s really important, it’s a job that people depend on and that the animals depend on. If the animals don’t get fed, they go hungry . . . it gives inmates a sense of importance and responsibility and commitment many of them haven’t had before.”

In return for the work, the farm donated compost and materials to build the garden at the jail, where the inmates grow beans, squash, lettuce, spinach, onions and tomatoes.

“One of the reasons we started a garden [was] to have people think about a healthy pastime,” Ms. Upton says. “When you go home after work, do you go to the bar and have a couple of drinks, or do you go to your vegetable garden that you learned how to enjoy, even if it’s just a little pea patch? It makes a difference.

“The farm gives them a taste of taking care of some animals or a garden, then here at the garden those skills are reinforced. They know that you have to go out and weed it and you have to get out and water it and you have to pick the vegetables.

“But then when you get to the table and the vegetables that you grew are on the table suddenly you’re a big shot. They may never have been a big shot with anything. But they’re a big shot and that’s good because that reinforces the skill and the importance and the self-pride that goes with nurturing.”

Ms. Upson praises sheriff Michael McCormack for allowing all this to happen.

“Because [the Dukes County jail] doesn’t look institutional, that kind of sets the tone for rehabilitation right from the get-go. You know, if it was a big brick or steel building with lots of barbed wire, suddenly people get frightened about what’s going on inside. But we have a lot of community people coming in to work with the inmates,” she says, before shutting the 1837 door with the click of its 2009 lock.