Chaplin's feature The Circus, released in 1928, was his last film before the motion picture industry embraced sound recording and brought the silent movie era to a close. As his own producer and distributor (part owner of United Artists), Chaplin could still conceive City Lights as a silent film. Technically the film was a crossover, as its soundtrack had synchronized music, sound effects, and some unintelligible sounds that copied speech pattern films. The dialogue was presented on intertitles. Chaplin was first contacted by inventor Eugene Augustin Lauste in 1918 about making a sound film, but he never ended up meeting with Lauste. Chaplin was dismissive about "talkies" and told a reporter that he would "give the talkies three years, that's all." He was also concerned about how to adjust the Little Tramp to sound films.
In early 1928, Chaplin began writing the script with Harry Carr. The plot gradually grew from an initial concept Chaplin had considered after the success of The Circus, where a circus clown goes blind and has to conceal his handicap from his young daughter by pretending that his inability to see are pratfalls. This inspired the Blind Girl. The first scenes Chaplin thought up were of the ending, where the newly cured blind girl sees the Little Tramp for the first time. A highly detailed description of the scene was written, as Chaplin considered it to be the center of the entire film.
For a subplot, Chaplin first considered a character even lower on the social scale, a black newsboy. Eventually he opted for a drunken millionaire, a character previously used in the 1921 short The Idle Class. The millionaire plot was based on an old idea Chaplin had for a short in which two millionaires pick up the Little Tramp from the city dump and show him a good time in expensive clubs before dropping him back off at the dump, so when he woke up, the Tramp would not know if it was real or a dream. This was rewritten into a millionaire who is a friend of the Tramp when drunk but does not recognize him when sober.
Chaplin officially began pre-production of the film in May 1928 and hired Australian art director Henry Clive to design the sets that summer. Chaplin eventually cast Clive in the role of the millionaire. Although the film was originally set in Paris, the art direction is inspired by a mix of several cities. Robert Sherwood said that "it is a weird city, with confusing resemblances to London, Los Angeles, Naples, Paris, Tangiers and Council Bluffs. It is no city on earth and it is all cities."
On August 28, 1928, Chaplin's mother Hannah Chaplin died at the age of 63. Chaplin was distraught for several weeks and pre-production did not resume until mid fall of 1928. Psychologist Stephen Weissman has hypothesized that City Lights is highly autobiographical, with the blind girl representing Chaplin's mother, while the drunken millionaire represents Chaplin's father. Weissman also compared many of the film's sets with locations from Chaplin's real childhood, such as the statue in the opening scene resembling St. Mark's Church on Kennington Park Road and Chaplin referring to the waterfront set as the Thames Embankment.
Chaplin had interviewed several actresses to play the blind flower girl but was unimpressed with them all. While seeing a film shoot with bathing women in a Santa Monica beach, he found a casual acquaintance, Virginia Cherrill. Cherrill waved and asked if she would ever get the chance to work with him. After a series of poor auditions from other actresses, Chaplin eventually invited her to do a screen test. She was the first actress to subtly and convincingly act blind on camera due to her near-sightedness, and Cherrill signed a contract on November 1, 1928.
Filming for City Lights officially began on December 27, 1928, after Chaplin and Carr had worked on the script for almost an entire year. On the set, Chaplin was noted for doing many more "takes" than other directors at the time. Production began with the first scene at the flower stand where the Little Tramp first meets the Blind Flower Girl. The scene took weeks to shoot, and Chaplin first began to have second thoughts about casting Cherrill. Years later, Cherrill said, "I never liked Charlie and he never liked me." In his autobiography, Chaplin took responsibility for his on-set tensions with Cherrill, blaming the stress of making the film for the conflict. “I had worked myself into a neurotic state of wanting perfection,” he remembered.  Filming the scene continued until February 1929 and again for ten days in early April before Chaplin put the scene aside to be filmed later. He then shot the opening scene of the Little Tramp waking up in a newly unveiled public statue. This scene involved up to 380 extras and was especially stressful for Chaplin to shoot. During this part of shooting, construction was being done at Chaplin Studios because the city of Los Angeles had decided to widen La Brea Avenue and Chaplin was forced to move several buildings away from the road.
Chaplin then shot the sequence where the Little Tramp first meets the millionaire and prevents him from committing suicide. During filming, Henry Clive suddenly decided that he did not want to jump into the tank of cold water in the scene, causing Chaplin to storm off the set and fire Clive. He was quickly replaced by Harry Myers, who Chaplin had known while under contract at Keystone Studios. Chaplin finished shooting the sequence on July 29, 1929 with exteriors at Pasadena Bridge. Chaplin then shot a sequence that was eventually cut from the film involving the Little Tramp attempting to retrieve a stick that was stuck in a grate. The scene included a young Charles Lederer; Chaplin later praised the scene, but insisted that it needed to be cut. He then continued filming the scenes with the millionaire until September 29, 1929.
In November, Chaplin began working with Cherrill again in some of the Flower Girl's less dramatic scenes. While waiting for her scenes for several months, Cherrill had become bored and openly complained to Chaplin. During the filming of one scene, Cherrill asked Chaplin if she could leave early so that she could go to a hair appointment. Chaplin fired Virginia Cherrill and replaced her with Georgia Hale, Chaplin's co-star in The Gold Rush. Although Chaplin liked her screen test, even he realized he had shot far too much already to reshoot all of the flower girl's scenes. Chaplin also briefly considered sixteen-year-old actress Violet Krauth, but he was talked out of this idea by his collaborators. Chaplin finally re-hired Cherrill to finish City Lights. She demanded and got a raise to $75 per week. Approximately seven minutes of test footage of Hale survives and is included on the DVD release; excerpts were first seen in the documentary Unknown Chaplin along with an unused opening sequence.
Chaplin then cast Florence D. Lee as the Blind Girl's grandmother and shot scenes with Cherrill and Lee for five weeks. In late 1929, Chaplin re-shot the first Flower Shop scene with Cherrill. This time, the scene was completed in six days and Chaplin was happy with Cherrill's performance. Chaplin had been shooting the film for a year and was only a little more than half way finished. From March to April 1930, Chaplin shot the scenes inside of the millionaire's house at the Town House on Wilshire Boulevard. He hired Joe Van Meter and Albert Austin, whom he had known since his days working for Fred Karno, as the burglars. In the late spring of 1930, Chaplin shot the last major comedy sequence: the boxing match. Chaplin hired Keystone actor Hank Mann to play the Tramp's opponent. The scene required 100 extras and Chaplin took four days to rehearse and six to shoot the scene and was shot between June 23 and 30. Chaplin was initially nervous over the attendance for this scene so he invited his friends to be extras. Over 100 extras were present. Chaplin's performance in the scene was so humorous that more people arrived daily to be an extra.
In July and August, Chaplin finished up six weeks of smaller scenes, including the two scenes of the Tramp being harassed by newsboys, one of whom was played by a young Robert Parrish.
In September 1930, Chaplin finished the shooting of the iconic final scene which took six days. Chaplin said that he was happy with Cherrill's performance in the scene, and that she had eventually understood the role. When talking about his directing style on set, Chaplin stated that "everything I do is a dance. I think in terms of dance. I think more so in City Lights."
From October to December 1930, Chaplin edited the film and created the title cards. When he completed the film, silent films had become generally unpopular. But City Lights was one of the great financial and artistic successes of Chaplin's career, and it was his personal favorite of his films. Especially fond of the final scene, he said, "[I]n City Lights just the last scene ... I’m not acting .... Almost apologetic, standing outside myself and looking ... It’s a beautiful scene, beautiful, and because it isn’t over-acted."
The amount of film used for the picture was uncharacteristic for the time and was a sign of the long production process. Chaplin shot 314,256 feet of film, and the completed film ran 8,093 feet. This made a shooting ratio of almost 39 feet of film for each foot of film that made it in the final version.
City Lights marked the first time Chaplin composed the film score to one of his productions. While Chaplin preferred his films to have live sound, by the 1930s most theaters had gotten rid of their orchestras. Many of his critics claimed he was doing it to grab more credit. Chaplin, whose parents and many members of the Chaplin family were musicians, was struggling with the professional musicians he hired and took it upon himself to compose the score. It was written in six weeks with Arthur Johnston and included over one hundred musical cues. Chaplin told a reporter that "I really didn't write it down. I la-laed and Arthur Johnson wrote it down, and I wish you would give him credit because he did a very good job. It is all simple music, you know, in keeping with my character." The intention was to have a score that would translate the characters' emotions through its melodies. The score was recorded in five days with musical arranger Alfred Newman.
The main theme used as a leitmotif for the blind flower girl is the song "La Violetera" ("Who’ll Buy my Violets") from Spanish composer José Padilla. Chaplin was unable to secure the original song performer, Raquel Meller, in the lead role, but used her song anyway as a major theme. Chaplin lost a lawsuit to Padilla (which took place in Paris, where Padilla lived) for not crediting him. Some modern editions released for video include a new recording by Carl Davis.