Each planet has surveillance satellites, which are loaded with rockets and blaster.
There are also units with anti-aircraft missiles, which can reach enemy ships, even if these are still in space.
The imperium also has heavy space cannons that can shoot big plasma balls that can destroy even an imperial ship with one shoot
There's also medium cannons, that are built even in the sea
Also, Imperial ships are deployed around each planet of a solar system. making an invasion nearly-impossible.