A judge at London's High Court banned Greenpeace activists from boarding or attaching themselves to ships being loaded at the Marchwood military port in the south coast city of Southampton.However, the judge refused to order Greenpeace's ship, the Rainbow Warrior, to move from its current mooring at the entrance to the port.
The Ministry of Defence had alleged the ship was effectively blockading the port.
Greenpeace anchored the Rainbow Warrior at Marchwood on Monday and has tried to block the departure of supply vessels.
Activists climbed the side of one of the ships after it set sail last week, prompting the military to blast them with water from high-pressure hoses.
Friday's court ruling was made at a preliminary hearing. Greenpeace and the government will return to the High Court next week.