The composition of the epic operatic tetralogy The Ring of the Nibelung occupied Richard Wagner for more than a quarter of a century. Conceived around 1848, the work was not finished until 1874, less than two years before the entire cycle was given its premiere at Bayreuth. Most of this time was devoted to the composition of the music, the text having been largely completed in about four years.

Wagner's method of composition

Like his libretti, Wagner's operatic scores generally passed through a series of distinct stages from sketch to fair copy; but because the composer altered his method of musical composition several times during the writing of the Ring, there is not the same uniformity in the evolution of the music that we find in the texts. Furthermore, it was often Wagner's practice to work on two or more drafts of a work at the same time, switching back and forth between them as the fancy took him. Consequently, it is all but impossible to make definitive statements about the exact order in which the various themes, leitmotifs and instrumentations were arrived at. Each score, however, did pass through at least three stages, there being seven possible stages in all:

Preliminary and supplementary sketches () – before beginning the composition proper, Wagner usually made some preliminary sketches to work on. Needless to say, he added supplementary sketches to these throughout the compositional process. These sketches are sometimes little more than fragmentary phrases jotted down on scraps of paper; but they can also be quite lengthy and elaborate sections of music written on several staves. Sometimes they are labelled (e.g. "Fafner", "Waldvogel"). Unlike the preliminary sketches for his earlier operas, however, which were usually settings of lines of text, the sketches for the Ring operas were generally worked out independently of the text; vocal sketches do survive, but more often than not even these are without text. It is highly unlikely that all Wagner's sketches have come down to us, and of course not everything need have been sketched – some of the music for the preliminary drafts may have been composed from scratch as it was required – but the "cleaner" a passage in a draft is, the more likely it is that it was preceded by a sketch. Preliminary draft () – the first complete draft in pencil (later traced over in ink) of the entire work (in the case of the first two Ring operas) or of an entire act (in the case of the last two). There is generally only one vocal stave and one or two instrumental staves. Instrumental interludes are sometimes elaborated on three staves. The preliminary draft for Das Rheingold was similar in detail to the one Wagner composed for Lohengrin, but those of the following three Ring operas were as detailed as Lohengrin's second complete draft (the so-called "composition draft"). Developed draft () – in the case of Siegfried (acts 1 and 2), the preliminary drafts were elaborated before Wagner proceeded to develop the full scores. In these intermediate drafts, he worked out all the orchestral details, including instrumental doublings. The developed drafts for the first two acts of Siegfried are in ink and are written on one vocal and two instrumental staves throughout. In WWV these developed drafts are called , a term which WWV also employs to describe the more elaborate second drafts of the later acts of the Ring. Orchestral draft () – in the composition of the third act of Siegfried and all three acts of Götterdämmerung, the preliminary draft was followed by an elaborate short score written in ink on two or three vocal staves and as many as five instrumental staves. These , as Wagner himself styled them, are even more detailed than the developed drafts of the first two acts of Siegfried. Instrumentation draft () – in the case of the four scenes of Das Rheingold, the preliminary draft was followed by what Wagner termed an , in which he worked out most of the orchestral details. This draft was written in pencil and on as many staves as were required by the instrumentation. It is thus but one remove from being a full score, and in WWV both are referred to by the same name. The instrumental prelude that precedes scene 1 was not included in the instrumentation draft, however, but was written out in ink in full score without any intermediate stage, as is explained below. Full score () – the final score, in which the instrumentation is fully detailed and separate staves are allocated to the various instruments and singers. The full scores for Die Walküre and Siegfried (acts 1 and 2) are in pencil; those for Das Rheingold (prelude), Siegfried (act 3) and the whole of Götterdämmerung are in ink. Needless to say, as many staves are used as are required by the instrumentation. No full score was made for Das Rheingold (scenes 1–4), as the instrumentation draft was considered sufficiently detailed for a fair copy to be made directly from it. Fair copy () – a clean copy in ink of the full score. Wagner only drafted fair copies for Das Rheingold, Die Walküre and the first two acts of Siegfried. In the case of the Das Rheingold (scenes 1–4), there was no full score as such, so the fair copy was the only copy of the full score. In the case of Siegfried (act 3) and the whole of Götterdämmerung the full scores were written neatly in ink, so Wagner did not deem it necessary to draft a separate fair copy. The fair copy of Das Rheingold was, incidentally, the first fair copy Wagner ever made of one of his operas.

Earliest sketches It took Wagner just over four years to complete the text of his Ring cycle (1848–1852). The composition of the music, however, would occupy him, on and off, for almost a quarter of a century. In the summer of 1850 he actually began to compose music for the prologue of (Siegfried's Death, as Götterdämmerung was originally called) before he had even conceived of the Ring cycle itself. This effort, however, was premature and Wagner abandoned the work near the beginning of the second scene, in which Siegfried takes his leave of Brünnhilde.

The following summer Wagner made another abortive attempt to compose music for his gradually emerging operatic cycle. Only a handful of sketches survive for (The Young Siegfried, as Siegfried was originally called). Some of these were later drawn upon when Wagner came to compose Siegfried proper in 1856.

A few other sketches survive from these early years. On 23 July 1851 Wagner wrote down on a loose sheet of paper what was to become the best-known leitmotif in the entire cycle: the theme from the "Ride of the Valkyries" ("Walkürenritt"). Other early sketches for Die Walküre were made in the summer of 1852. There also exist three sets of isolated musical sketches for Das Rheingold which were composed between 15 September 1852 and November 1853. The first of these was entered into the verse draft of the text, the second into Wagner's copy of the 1853 printing of the text; the third was written on an undated sheet of music paper. All three were subsequently used by Wagner.

The idea for the prelude of Das Rheingold famously came to Wagner in a "vision" he had on 5 September 1853 as he lay in a semi-conscious state in an inn at La Spezia, Italy:

After a night spent in fever and sleeplessness, I forced myself to take a long tramp the next day through the hilly country, which was covered with pine woods. It all looked dreary and desolate, and I could not think what I should do there. Returning in the afternoon, I stretched myself, dead tired, on a hard couch, awaiting the long-desired hour of sleep. It did not come; but I fell into a kind of somnolent state, in which I suddenly felt as though I were sinking in swiftly flowing water. The rushing sound formed itself in my brain into a musical sound, the chord of E-flat major, which continually re-echoed in broken forms; these broken chords seemed to be melodic passages of increasing motion, yet the pure triad of E-flat major never changed, but seemed by its continuance to impart infinite significance to the element in which I was sinking. I awoke in sudden terror from my doze, feeling as though the waves were rushing high above my head. I at once recognised that the orchestral overture to the Rheingold, which must long have lain latent within me, though it had been unable to find definite form, had at last been revealed to me.

However, it was not until 1 November 1853, at his lodgings in Zurich, that he finally sat down and began the first continuous musical draft of the tetralogy. Five and a half years had passed since he had completed his last opera, Lohengrin.

Das Rheingold

The composition of Das Rheingold occupied Wagner from 1 November 1853 to 26 September 1854. He began by developing a preliminary draft () of the entire work from his sketches. This 77-page draft, which was written in pencil and on two (sometimes three) staves, was completed by 14 January 1854. The following month (1 February) he proceeded to make a second complete draft. It seems that his first intention was to make a composition draft in ink, just as he had done for Lohengrin, but as such a draft of the prelude – which consists of little more than an arpeggiated E major triad – would have been to all intents and purposes a full score, he decided to skip the intermediate stage and draft the full score in ink right away. This he proceeded to do with the prelude, significantly revising some of its details in the process. When, however, he reached the beginning of scene 1, he found that the remainder of the opera required too much revision and elaboration to allow him to develop a full score without first making a second complete draft. He therefore abandoned the full score in ink and proceeded to develop instead an instrumentation draft in pencil, in which he worked out most of the vocal and orchestral details of the four remaining scenes. This , as Wagner himself styled it, was completed by 28 May 1854.

Two things should be noted about the second complete draft of Das Rheingold. Firstly, the full score of the prelude (in ink) and the instrumentation draft of the remainder of the opera (in pencil) together constitute a single manuscript (WWV 86A Musik III). In WWV this is called a , a term usually reserved for Wagner's full scores: strictly speaking only the section in ink is a . Secondly, the manuscript is fragmentary: thirty-three measures are missing, which include the closing measures of the prelude and the opening measures of scene 1. As ink is used before this lacuna and pencil after it, it is generally assumed that Wagner switched from one medium to the other at the entrance of the voices (i.e. the first measure of scene 1); but until and unless the missing sheets are recovered, this must remain an assumption.

The final stage of the compositional process was the writing out in ink of a fair copy of the full score (). This task was begun by Wagner himself on 15 February 1854, while he was still at work on the instrumentation draft. It was delayed, however, by his decision to start work on Die Walküre (28 June 1854). Sometime in the summer of 1854 he hired a copyist to make a fair copy in ink of Das Rheingold (using his own unfinished fair copy as a model), but the copyist's work was so full of blunders that Wagner was forced to dismiss him and resume work on his own copy. He worked at it on and off for several months, alternating this work with the ongoing composition of Die Walküre. By 25 September 1854 the fair copy of Das Rheingold was finally completed. Wagner then sent it to the Dresden copyist Friedrich Wölfel, who completed a beautiful and very accurate ink copy on 11 November 1855. Wöfel's copy was used as the source-text () for the first public printing of the complete opera in 1873.