Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq) ; Fundação de Amparo à Pesquisa do Estado de São Paulo (FAPESP) ; We present a direct measurement of the width of the W boson using the shape of the transverse mass distribution of W -> e nu candidate events. Data from approximately 1 fb(-1) of integrated luminosity recorded at s=1.96 TeV by the D0 detector at the Fermilab Tevatron pp collider are analyzed. We use the same methods and data sample that were used for our recently published W boson mass measurement, except for the modeling of the recoil, which is done with a new method based on a recoil library. Our result, 2.028 +/- 0.072 GeV, is in agreement with the predictions of the standard model.