It was mostly filmed in New York State, except for two weeks in October 2017 where it was film in Pittsburgh, PA. Some of the scenes (like courtyard scenes) are actually filmed at Dannemora Prison (for some of the scenes prisoners were held on lockdown), after Ben Stiller (the director) received permission from Governor Cuomo himself. But most of the prison and cell interiors were done on a regular soundstage.