Measure the overall exterior dimensions of the washing machine with a tape measure. Add inches to account for clearance of vents and cords. Electric washers require a few inches behind the machine. Gas-driven washers need at least 12 inches for clearance of the lines and vents.
Measure the washer with the lid open. Use the height of the washer plus the height of the open lid for top-mounted machines; use the width of the machine plus the width of the open door for front-loaded machines.
Measure across the front of the washer. Add a 2-inch allowance on both sides of the front to account for the clearance along the sides. This also allows for escaping heat.
Use the above measurements for the interior measurements of the cabinet. Mark the positions of the measurements on the floor with chalk. Snap a chalk line from the wall to the front corners of the measured area. Snap a chalk line across the front between the corners. These lines are the minimum required dimensions for the cabinet.
Locate the studs along the wall behind the washer closest to where the washer will go with a stud finder. Mark the stud locations with chalk. These will identify where the side walls will go; they may not line up with the original chalk line. Make sure these studs are outside of the original chalk line; use the next available studs if adjustments are needed to match the chalk lines.
Mark the wall measurements and corner locations along the ceiling joists.
Measure two 2-by-4-inch boards the length of the measurements for the width of the side walls. You should have two top plates and two bottom plates. Cut the lumber to these measurements using a circular saw.
Position your top and bottom plates for the side walls into place. Hammer 16d nails through the plates into the floor and ceiling joists using two nails per joist.
Take measurements of the distance between the inside edges on the ends of the top and bottom plates; these become the length of the end studs for both walls. Measure and cut 2-by-4-inch boards corresponding to these measurements for the end studs.
Position your studs vertically so their ends butt against the inside edges along the ends of the top and bottom plates. Toenail 16d nails at a 45-degree angle through the studs into each plate.
Center the end of your tape measure on a stud's 2-inch side. Measure alongside a plate a distance of 16 inches and mark this location. Reposition the tape measure to the last marked location and repeat the step. Continue along the plate to the opposite end stud. Repeat the entire process for the second wall.
Align and attach the studs using the same methods used to set up the end studs for the walls.
Measure the distance between the two side walls along the ceiling and floor. Snap a chalk line on both surfaces. Cut your top and bottom plates to size.
Install the top and bottom plates the same way you installed them for the side walls.
Measure the door height. Mark and cut this measurement on two 2-by-4-inch boards with a circular saw.
Measure the width of the door and add 4 inches. Subtract this number from the overall measurement of the top plate. Divide the total by two. Use that number as the measurement needed from one end of a full stud toward the center on each end. Mark the position on the top plate.
Align two full-length studs with the marks on the top plate. Install these studs using the same methods used to attach the other studs in the walls.
Line up the door-length studs against the inside-facing edges of the full-size studs. Attach the smaller studs to these via 16d nails.
Measure the distance between the inside-facing edges of the full-sized studs. Mark and cut two 2-by-4-inch boards to this measurement. Sandwich these boards between the full-sized studs atop the door studs. These are the door headers. Attach these to the studs and to each other with 16d nails.
Line the door frame up with the door studs and header. Attach the frame to the studs and header by drilling the provided screws through the frame into the surrounding wood.
Operate the door repeatedly to see if it hangs properly. Adjust the hinges or add shims to the frame to adjust the door frame.
Cover each wall with your choice of panel, drywall or plywood.