“Rebuild your childhood” is Cody Wells’ motto.

The 37-year-old Astoria man’s done better than that. In fact, Wells makes more than $200,000 a year as a professional Lego designer.

“For some people, it is a toy,” says Wells, an artist-for-hire who’s not officially associated with the plastic-brick company. “For me, it is a borderline compulsion. It’s the only thing that’s ever made me feel like I belong. I don’t know if that’s a sad thing or a blessing in disguise.”

Apparently, Wells isn’t the only one. He’s just one of a dozen Lego lovers featured in the documentary “A Lego Brickumentary,” playing in theaters and video-on-demand Friday.

“As we made the film, I think we were forced to question the definition of what a toy is and whether this is a toy or a tool or something else,” says Daniel Junge, who co-directed the movie with Kief Davidson.

For Wells, it’s a living. Once $25,000 in debt, he now works as an artist, creating museum-worthy Lego structures for wealthy clients.

One couple recently commissioned him to design a large mosaic-style portrait for their son’s bar mitzvah. As the viewers moved across the work, they saw the boy-of-the-hour transition into a man.

Another of Wells’ personal favorites is an image of Lucille Ball he created that suggests a piece by Andy Warhol. For eight months, he rented out that portrait to the colorful Ellen’s Stardust Diner in Midtown.

Each custom creation takes about a week to produce.

Wells traces his affinity for the little bricks back to 1984, when he was 6 years old and afraid of what ghouls might be lurking under the bed. His father suggested he make a “ghost trap” out of his red bucket of Legos. Cody did as he was told, and those pesky ghosts never bothered him again.

The only thing that haunted him was his love of building with blocks — something he turned into his livelihood in 2010, when he moved to New York. Before then, he’d been working in the auto and food service industries.

“When I started my company [C3Brix], I was living in a four-bedroom apartment with three roommates,” he said. “I had Legos under the bed, in the closets. I can’t tell you how many times my fiancée would call me at work and ask if there was a bed to come home to.”

When he isn’t building sculptures on commission, Wells works with children who don’t know how to connect the blocks.

“Parents call me and say, ‘My kid’s not into sports,’ ‘My kid doesn’t like rock music,’” he says. So they come work with him at Little Shop of Crafts on the Upper West Side, where he’s the “in-house Lego builder.” He teaches monthly themed workshops, gives one-on-one classes and even hosts Lego birthday parties for creative youngsters.

“I give them hope,” he says. “I’m not there for the popular kid.”

His own children, now 12 and 14, live with his ex-wife in Michigan. Although Wells has them for eight weeks every summer, he tries to inspire them long-distance by following his dream.

“I turned [my passion] into a job,” he says, “so I could be happy with my life.”

How he turned toys into cash