(covers information from several alternate timelines)
The USS Franklin (NX-326) was a 22nd century Federation Freedom-class starship operated by Starfleet. It was the first Earth ship capable of reaching warp factor 4. Its armaments, typical of the era, included pulsed phase cannons and spatial torpedoes. Its defenses included polarized hull plating. Auxiliary craft included a complement of shuttlepods. (Star Trek Beyond)
Following the Earth-Romulan War and the formation of the United Federation of Planets, the Franklin received a new dedication plaque and was placed under the command of Captain Balthazar Edison, a former MACO veteran of the Xindi and Romulan wars. After many further missions and adventures the ship vanished in 2164 while on a mission in the Gagarin Radiation Belt, an incident later taught to future Starfleet officers at Starfleet Academy. Speculation abounded about the ship's disappearance, with theories ranging from it surrendering to the Romulans to being captured by a "giant green hand".
However, the distance traveled suggested a wormhole displacement. The ship eventually crash-landed on the planet Altamid. As no sign of rescue came, Edison came to believe the Federation deliberately abandoned them. Edison discovered relics left by Altamid's native species, including numerous ships, a drone workforce, and life-sustaining technology capable of stealing the "life force" from its victims. Edison and his crew abandoned the wreck of the Franklin and turned against the Federation.
By 2263 of the alternate reality, the Franklin had been discovered, half-buried under the surface of Altamid, by Jaylah, who placed it under a holographic cloak to use as a residence. The Franklin had functioning power reserves, serviceable engines, and intact data logs despite a century of neglect. Before her encounter with the crew of the late starship USS Enterprise, Jaylah had begun repairs on the Franklin, learning English from its on-board computer and becoming familiar with the "classical" music of 20th century Earth stored in the ship's data banks.
Marooned on Altamid, Captain James T. Kirk, Commander Spock, Lieutenant Commander Montgomery Scott, and Ensign Pavel Chekov further repaired the Franklin, restoring its transporter capability, and, enhancing it to transport complex lifeforms rather than simply cargo, they rescued the Enterprise crew imprisoned by Krall. Learning of Krall's plan to use his swarm ships and the super weapon known as the Abronath to attack the Federation Starbase Yorktown, Kirk and company successfully piloted the Franklin out of Altamid's atmosphere by dropping the ship off a cliff in order to reach terminal velocity (as the ship had never been designed to land, they had to let it free fall in order to create enough forward momentum to achieve escape velocity).
Encountering Krall's forces at Yorktown, Kirk and company piloted the Franklin into the swarm. Using the ship's antiquated technology, Kirk's crew disrupted the individual vessels' communications with radio signals and created a chain reaction that destroyed most of the swarm. Pursuing Krall and two remaining ships, the Enterprise crew piloted the Franklin into Yorktown's internal docking structure, using the ship itself to destroy the attacking vessels before crashing into Yorktown Central Plaza near Yorktown Headquarters. In the aftermath, Kirk and Commodore Paris officially closed the missing-in-action report on the Franklin and its crew. (Star Trek Beyond)
Star Trek Beyond Director and Producer Justin Lin felt that including a pre-Federation ship in the film satisfied a goal he had – for the movie to explore and embrace everything in the Star Trek canon. He also believed the craft seemed to service the film's plot and its themes. In hindsight, he noted about the concept, "It felt pretty organic." In fact, the creative staff loved the idea that, whereas the survivors from the Enterprise were initially under the impression that they were the first Humans on Altamid, there was some antiquated Federation technology elsewhere on the planet, proving otherwise. ("Beyond the Darkness", Star Trek Beyond (Blu-ray)/(Blu-ray 3D)/(4K Ultra HD))
After deciding to include such a vehicle in the movie, the filmmakers next had to determine some precise details about it. Screenwriter Doug Jung explained, "We took a lot of care into making sure that we were specific about what kind of ship it was and what it could do, so that it fits in the timeline of all that stuff, which is really well established." ("Beyond the Darkness", Star Trek Beyond (Blu-ray)/(Blu-ray 3D)/(4K Ultra HD))
At first, the vessel was considerably different from how it turned out. Supervising Art Director Don Macaulay observed, "The Franklin had a small role in the movie when we started." ("Exploring Strange New Worlds", Star Trek Beyond (Blu-ray)/(Blu-ray 3D)/(4K Ultra HD)) The ship was originally to have been named the "Pioneer", which it was called in an early screenplay for Star Trek Beyond. In the same script, the vessel was a significantly smaller scout ship that Scotty found in a desert, buried under sand. The creative personnel imagined him entering it by climbing through a hatch at the top of the ship, then getting the craft working again. Once Kirk and the rest of his team had rescued the other members of the crew, the screenplay called for them to somehow get back on board the craft. The script also made it clear that the vessel was a relatively old Starfleet ship that could withstand an extreme beating but had been lost on the planet for a long time. As the script proceeded to develop through successive drafts, the vessel's role in the story became increasingly more important. (Star Trek: The Official Starships Collection, USS Franklin Special Issue, pp. 7, 10, 11, 12, 13 & 14)
The ship was designed by Sean Hargreaves, who described it as initially being "almost like a large shuttlecraft."  By the time he began producing concept images of the ship, it had been reconceived as a freighter. The designer produced a couple of images that showed the craft buried under the sand. In another of his earliest concept illustrations of the vessel, it bore the name "USS Pioneer" and was portrayed as launching into the planet's atmosphere, aided by external rocket packs which Scotty had attached to the vehicle's underside. Hargreaves was mindful of the fact that the ship had been fiercely pounded before crash landing on the planet's surface. (Star Trek: The Official Starships Collection, USS Franklin Special Issue, pp. 10, 11 & 14)
The use of the NX prefix and USS would seem to have been added after the formation of the Federation, as United Earth starships depicted in the mostly pre-Federation series Star Trek: Enterprise did not commonly use USS and the NX prefix was only used for ships in the NX-class or part of the NX Project and Warp Five program.
Unsure how Kirk and his associates would load supplies onto the ship, Sean Hargreaves devised a way for them to manually access the vessel through a ring of large cargo bay doors he positioned on the top of the vehicle. However, this sequence ultimately didn't make it into the movie, as the film's other creative personnel decided that Kirk and his cohorts would simply beam aboard the vessel instead, so Hargreaves changed the doors into prominent ridges that were meant to represent some kind of an array. (Star Trek: The Official Starships Collection, USS Franklin Special Issue, pp. 14-15 & 17)
At first, Sean Hargreaves intended for the craft to be capable of ascending and descending vertically. Although he even did variations of the ship with landing struts to facilitate these maneuvers, the scripted depiction of the ship and its launch sequence continued to evolve. Essentially, the vessel was now conceived as being discovered by Scotty at the top of a mountain and sliding down the side of that mountain during takeoff, so the landing struts were never shown. (Star Trek: The Official Starships Collection, USS Franklin Special Issue, pp. 15-16)
By the time this change was made, the craft had been renamed the "Franklin". (Star Trek: The Official Starships Collection, USS Franklin Special Issue, p. 16) That name was chosen in recognition of Justin Lin's father, Frank Lin; the vessel's dedication plaque has a slightly wider gap between the letters "k" and "l" to further emphasize this tribute. The Franklin's registry number, 326, was in honor of Leonard Nimoy's birthday. 
Once Sean Hargreaves completed his version of the ship and the design had finally been approved, the craft was tweaked for its portrayal in the film by the visual effects staff at Double Negative. They were tasked with adjusting the Franklin on a shot by shot basis. After deciding which materials would be included in the vessel's construction, the VFX team added a load of debris which they imagined as having literally grown over the ship's hull during the ages it had spent grounded on Altamid. "It had been sitting there for a couple of hundred years so it had dirt and rocks and trees growing on it," stated VFX and Associate Producer Ron Ames. "It was kind of funky when it took off." (Star Trek: The Official Starships Collection, USS Franklin Special Issue, pp. 17-18) Double Negative made the vessel look appropriately battered, due to the intention of the Franklin being an old and rusty vessel. (Cinefex, No. 138, p. 91)
The VFX group also carefully worked out the additional damage sustained by the ship while it, immediately after launching, falls over the cliff, endures a battle with the swarm ships, and finally crashes its way into Starbase Yorktown. All of that damage needed to be recorded so it could be tracked in each shot. (Star Trek: The Official Starships Collection, USS Franklin Special Issue, pp. 17-18) During the craft's transit, Double Negative took the ship through five stages of destruction. (Cinefex, No. 138, p. 91) "We added scrapes when it comes off the edge of the cliff," Ron Ames recollected, "then you had to know where it had been hit by swarm ships, so you build a history of the damage and follow that through." (Star Trek: The Official Starships Collection, USS Franklin Special Issue, p. 18) CG Sequence Supervisor Rhys Salcombe explained, "At the point where it smashes through Yorktown''s door, we entered damage state three, which was pretty mangled. As it's flying through the docking tubes, it bangs off various things and gets additional dings and scratches. After the breach, we went into stage five. The ship is broken beyond repair at this point – it's a wreck, revealing a lot of its interior structure." (Cinefex, No. 138, p. 91)
The creative personnel also wanted to make the Franklin appear convincing in the space battle and during its very eventful journey into the starbase, about which Ron Ames commented, "We really tried to make that as real as possible." The battle was modified to include the craft firing in retaliation at the swarm ships, even though the Franklin had heretofore been thought of as having either no weaponry whatsoever or minimal weaponry that was no longer functional. "As the third act was rewritten when we were editing," said Ames, "we had to add weaponry to tell the story, otherwise it would have been a sitting duck." Making the vessel apparently tougher in this way made it seem more believable that the Franklin managed to last as long as it did while enduring so much damage. (Star Trek: The Official Starships Collection, USS Franklin Special Issue, pp. 18 & 19)
Ultimately, members of the film's shooting company highly approved of the Franklin. Don Macaulay remarked, "It became a very important part of the movie [....] I think it turned out to be a great-looking set." ("Exploring Strange New Worlds", Star Trek Beyond (Blu-ray)/(Blu-ray 3D)/(4K Ultra HD)) Ron Ames enthused, "I thought the way the Franklin behaved in the final battle and as it came into the space station was beautifully designed [....] It was very successful and pretty cool." (Star Trek: The Official Starships Collection, USS Franklin Special Issue, p. 18) Kirk actor Chris Pine raved, "Every nook and cranny on the Franklin, and the detail work is extraordinary, from the painting to the electronics. It's just mind-boggling. You know, stuff that maybe no one will see, but in the moment of acting in that space, it's incalculable, the effect that it has on me. It just adds to this world that we're creating, and it's super fun." Jaylah actress Sofia Boutella was also impressed by the set of the Franklin. ("Exploring Strange New Worlds", Star Trek Beyond (Blu-ray)/(Blu-ray 3D)/(4K Ultra HD))
In 2016, collectible miniatures of the ship were produced by Snapco and QMx as home video and theater concession stand premiums. Three more miniatures are slated for release by Hallmark, QMx, and Eaglemoss Collections' Star Trek: The Official Starships Collection partwork magazine in 2017.
Regarding the vessel's origins, Dylan Highsmith said, "If you want the official explanation on the Franklin and its warp factor: it was a MACO ship (or a United Earth Starfleet ship that housed MACO personnel at times) that predates the NX-01. When the UFP Starfleet is formed, MACO was disbanded and the ship was reclassified as a Starfleet ship [with the 'USS' identifier]. The ship is then 'lost' in the early 2160s. It was important to everyone that the ship, like Edison, predate the Federation; that thematically, the ship mirrored an earlier time in history and served as a bridge in design between then and the NX-01. Doug and Simon may have worked up something [on an official launch date], but if they did it never made it to script or screen. Either way it predates the NX-01, and was reclassified after the UFP is formed." 
The possible launch date of the Franklin as Earth's first warp 4 vessel can be narrowed down based on information from ENT: "First Flight", which established that the warp 3 barrier was first broken by the NX-Delta in 2145, and that the construction of Enterprise, Starfleet's first warp 5 ship, began in 2150. Therefore, the launch of the Franklin likely occurred within that range.