In 1861, the main Confederate port was Portsmouth, home of the Gosport Navy Yard. The CSS Virginia was constructed there from the sunken remains of the USS Merrimack. It was intended to keep the James River under Confederate control.
At the start of the 1862 Peninsula Campaign, the "battle of the ironclads" revealed that the Confederate Navy could no longer block the Union Navy from travel in Hampton Roads. The CSS Virginia sought to escape upstream, but the heavy ironclad required deeper water to maneuver. The Confederates destroyed their first ironclad and withdrew upstream to Drewry's Bluff.
Confederates fortifications blocked Union forces from moving past Drewry's Bluff, upstream from the Appomattox River
Source: Library of Congress, Map of the country between Richmond and Petersburg
Artillery placed there on the high bluff and obstructions placed in the river channel blocked Union efforts to steam upstream and attack Richmond from the water. After the retreat upstream, the Confederate Navy based the James River Squadron at Richmond.1
Between 1862-1864 the navy also constructed three ironclads (CSS Richmond, CSS Virginia II, and CSS Fredericksburg) at the Confederate Navy Yards, at Rocketts Landing and at Manchester on the south bank of the James River. The ironclads enhanced the defense against any possible water-based attack on Richmond by Union forces.
the Confederate Navy's James River Squadron was based at Rocketts and Manchester between 1862-1865
Source: Library of Congress, Views of Rocketts and south side of James River from Libby Hill
After failing in 1862 to get past Drewry's Bluff, the Union Navy created its own blockade of the James River downstream of Trents Reach. All commercial shipping to and from Richmond stopped.2
sunken ships and onshore batteries kept the Union and Confederate navies from steaming past Trents Reach from 1862-1865
Source: Library of Congress, Deep Bottom, Va., vicinity. Transport Linda of Philadelphia and a monitor (Onondaga?) on the James
in 1864, Union forces used City Point as their main supply base for the siege of Petersburg, but ship traffic further upstream on the James River was blocked by a Confederate blockade at Drewry's Bluff
Source: Internet Archive, View of the James River and the Bend Around Farrar's Island, Above Dutch Gap (by Alfred E. Waud, in Harper's Weekly, September 17, 1864, p.604)
In 1864, Union forces tried to dig a canal through the bend in the James River at Dutch Gap. The plan was to bypass Confederate fortifications such as Battery Dantzler so Union ships could steam upriver, then shell or capture Richmond. US Colored Troops and a steam dredge did most of the digging, while Confederates fired mortar shells to disrupt the project.
By January, 1865, a ditch had been excavated across the narrow neck of land, with just one remaining barrier on the upstream end. The canal construction may have destroyed the site of Henricus, established in 1611 by Sir Thomas Dale to replace Jamestown.
Blowing up that bulkhead allowed some water to flow into the canal, but it was not deep enough to allow the Union gunboats to pass through it. The Union general in charge was fired and the project was abandoned.3
the Dutch Gap Canal was not finished until after the Civil War
Source: Library of Congress, Bermuda Hundred [1864-1865]
the Dutch Gap Canal, begun in the Civil War, was finished in 1878 and expanded in the 1930's
Source: Internet Archive, Harper's Weekly (January 21, 1865)
Soon after the canal project stopped, Confederates sought to move downstream. Winter floods disrupted the Union obstructions at Trent's Reach, and the downriver Confederates offensive started on January 23, 1865. The goal was to destroy the supplies at City Point, disrupting the siege of Petersburg.
The CSS Fredericksburg made it through the Union blockade, but returned to assist the CSS Richmond and CSS Virginia II after they ran aground. The primary Federal warship to block the attack was the USS Onondaga, and it fled downstream.
After General Grant learned of the threat, he sent more Federal ships upstream. The CSS Drewry was sunk, the Confederates withdrew, and a second attempt on January 24 was also blocked.
After the fall of Petersburg in April, 1865, the Confederate politicians and military evacuated Richmond. On the night of April 3,1865 the Confederate Navy blew up CSS Richmond, CSS Virginia II, and CSS Fredericksburg. In addition to the ironclads, other Confederate warships in the James River and the navy yards at Rocketts and Manchester were destroyed.4
the Confederate Navy built three ironclads in Richmond between 1862-1864, then destroyed them when the city was evacuated on April 3, 1865
Source: Virginia Department of Historic Resources, The Richmond Ironclads at Trent's Reach, James River
the CSS Virginia blocked Union ships from sailing up the James River at the start of the Peninsula Campaign
Source: Smithsonian Institution, Battle between the Monitor and Merrimac
the Union Navy was unable to force its way upstream past Drewry's Bluff during the Seven Days battles in 1862
Source: Library of Congress, Position of Richmond, Va. (1862)