PARIS—France is transforming its capital city into an open-air fortress, rolling out the largest peacetime security operation in the country’s history to protect athletes, residents and more than 10 million visitors during the Olympic Games .

Officials say as many as 45,000 police, 10,000 soldiers and 22,000 private security guards will keep watch at the Paris Olympics , which begins Wednesday and spans the heart of the city—on streets, at landmarks and in the waters of the Seine River.

Place de la Concorde, the city’s largest public square, is set up for BMX bike races, skateboarding and breakdancing, a French addition to the Games. Sand-covered beach volleyball courts are going up in front of the Eiffel Tower. Archers will loose arrows on the grassy esplanade by the Invalides, a 17th-century military complex that houses Napoleon’s tomb.

France’s plan to conduct the Games at locales around the city is intended to demonstrate that Western democracies, for all their tumult, can host a monumental event that is accessible to the public. The security challenge is as immense as the scale of the quadrennial contest that is expected to draw around 10,500 athletes from more than 190 nations, along with 100 or so world leaders.

Authorities are preparing for potential attacks by Islamist militants, as well as state-sponsored sabotage originating in Russia or Iran, French officials said. Wars in Ukraine and Gaza have magnified those threats, according to Western officials and security experts.

“The idea is really to have events in the heart of the city, to allow access for as many people as possible,” said Nicolas Nordman , security adviser to the mayor of Paris. “That means the security challenges are clearly more significant than doing this in a stadium.”

France is mobilizing nearly three times as many security personnel as the number deployed for the London Olympics, the last one held in Europe.

American police departments for the first time are lending a hand to an overseas Olympics host, including officers from New York, Los Angeles and Fairfax County, according to U.S. diplomatic security service officials who coordinated the arrangements with France. The U.S. also is sending bomb-sniffing dogs at the request of France.

The thorniest security challenge will be protecting the opening ceremony on Friday, expected to be the most-attended Olympics kickoff in modern history. A 4-mile parade of boats on the Seine will carry the Olympic athletes, who in past Games traditionally marched through more easily protected stadiums. Authorities estimate the ceremony will draw 300,000 spectators.

“The security measures and the resources deployed for the Games’ opening ceremony are unprecedented,” said Bruno Le Ray , a retired general who is in charge of Olympics security for the Paris 2024 organizing committee.

The banks of the Seine were sealed off to the public a week ahead of the ceremony. During the event, police will be stationed every 6 feet or so along the river, said Loïc Walder , a spokesman for UNSA, one of France’s largest police unions. Authorities are clearing homeless encampments that dot the river banks and moving people into temporary housing.

The French military will close off surrounding airspace during the opening ceremony and deploy antidrone squads throughout the Games.

The government also is unspooling a massive dragnet to shield the Games from potential terrorists and saboteurs. Police have sent administrative orders forbidding people deemed a security risk from coming near Olympics events, interior ministry officials said. They are conducting more than one million background checks of people living around and working in restricted areas related to the Games.

French security services face the challenge of keeping tabs on thousands of suspected Islamist extremists and people who have been convicted of terror offenses since the deadly attacks in the country by Islamist militants in 2015 and 2016.

The Paris Games happen to coincide with one of France’s biggest political crises in decades. Snap elections called by President Emmanuel Macron have left France with a fractured parliament. His government resigned July 16, remaining only as a caretaker until a new one is formed.

The potential for unruly mass demonstrations over the elections adds to the pressure on French police charged with securing the Paris Games. Unions have called for protests to pressure Macron to allow a leftist coalition to form a new government after it won the largest number of seats in parliamentary elections this month.

“We must be careful that our people don’t arrive at the Olympic Games exhausted or injured,” said Walder, the police union spokesman.

Under orders

A 40-year-old software developer, his wife and three children were asleep in their Paris apartment last month when a squad of French police broke down his door. They handcuffed the man and ordered him to reveal the passwords to his computer and phone.

The man had served 10 months in prison for spreading Islamic State propaganda on social media in 2015 and 2016, and he was released from parole in 2022. Police said they were investigating whether he was a threat to the Games.

Authorities spent two hours searching his apartment and found no incriminating evidence, according to the man and his lawyer. Days later, the man received a notice from the Interior Ministry forbidding him from visiting any sites of the Games. The ministry ordered him to check in with his local police station every morning at 8 a.m. for the next three months, according to a copy of the order reviewed by The Wall Street Journal.

“I haven’t had any contact with radicalized people. I kept away from all of that,” the man said.

“All of my old clients are calling me,” said the man’s lawyer, Jean-François Morant , including more than 10 people seeking to challenge the administrative orders in court. “I can understand the Interior Ministry wants to secure the games. But when they take measures that restrict freedom so much—this, I understand less.”

Interior Minister Gérald Darmanin said 155 people were subject of such orders, and 164 “home visits” were conducted before the Games.

The government is using the Paris Olympics to test new security technology, including algorithmic video surveillance. Computer programs analyze live video streaming from cameras throughout the country and alert police to fires, dangerous crowd movements, a person with a weapon and other potential threats. Video cameras nationwide connect to a command center overseen by the Interior Ministry.

Officials said defending against a cyberattack was a priority because event tickets will all be electronic. Hackers targeted the opening ceremony of the 2018 Winter Olympics in South Korea, shutting down computer systems at the stadium and frustrating people trying to retrieve their e-tickets.

Russia is the main concern, officials and security experts said. Macron has pushed Western allies to station military personnel inside Ukraine, crossing a red line drawn by the U.S. and some in Europe to avoid directly confronting Moscow.

“They’re going to try and disrupt the Games,” said Dale Buckner , chief executive of Global Guardian, which is providing security at the Olympics for corporate delegations and affluent families. “The objective is to embarrass the French government and put a stain on the Games.”

French authorities said Tuesday they arrested and charged a 40-year-old Russian man with planning an operation to sow disorder at the Olympics.

The International Olympic Committee announced Paris was a candidate city in September 2015. Two months later, Islamic State militants killed more than 130 people in coordinated attacks across the Paris region. The following year, an Islamist radical drove a truck through a packed boardwalk in Nice on Bastille Day, killing 86 people.

The truck attack showed how an unarmed extremist could produce mass casualties. French authorities canceled dozens of events around the country for the rest of the summer, concluding that security forces didn’t have the resources to protect against such threats.

Despite the security challenge, officials saw hosting the Games as a way for France to bounce back.

Take the plunge

In May 2017, two days after Macron was sworn in, he hosted inspectors from the Olympic Committee at the Élysée Palace to make the case for Paris.

Early on, French officials said the Paris Games would help the development of France’s blighted suburbs. The Olympic Village and the media center were built in Seine-Saint-Denis, one of the country’s poorest districts. The site will eventually be converted into commercial offices and housing, some of it subsidized. The new aquatics center will serve local residents.

The idea to hold the opening ceremony on the Seine came from Tony Estanguet , the former Olympic canoeist in charge of the Paris 2024 organizing committee. He gave his pitch to Macron during a meeting in 2020.

“At the very beginning, it seemed to be a crazy and not very serious idea,” Macron said Monday. “But we decided it was the right moment to deliver this crazy idea and make it real.”

The Interior Ministry first needed to make sure that the plan for the ceremony could be carried out safely, Le Ray said.

At first, the Paris 2024 organizing committee hoped to welcome as many as 600,000 spectators for the opening ceremony. They cut that number in half, largely for security reasons.

More than 100,000 people are expected to watch from ticketed seats on the lower banks of the Seine, closer to the spectacle. Ticket prices for the most plum riverbank spots near the Eiffel Tower, Place de la Concorde and the Louvre are selling for as much as €2,700, just under $3,000. The city has been sending free tickets to Paris residents for the river’s upper banks.

Luxury conglomerate LVMH , controlled by French billionaire Bernard Arnault —among the world’s wealthiest individuals—is hosting an opening ceremony party at its Cheval Blanc hotel, overlooking the Seine.

During the Games, the Seine will host open-water swimming, the triathlon and other events. France spent $1.5 billion to limit sewage runoff, opening the river to swimming for the first time in a century. The government built a massive underground tank to store a mix of sewage and rainwater that for decades flowed into the Seine after a heavy rainfall.

French politicians have taken a dip in the river as a show of confidence, despite test results showing bacteria levels in the famed waters still exceed safety thresholds on some days.

“It’s great,” said Paris Mayor Anne Hidalgo after her plunge in front of journalists and onlookers. “Not only can we welcome the games but also swim in the Seine in the years to come.”

Write to Matthew Dalton at Matthew.Dalton@wsj.com and Noemie Bisserbe at noemie.bisserbe@wsj.com