Viruses cannot replicate by themselves, because they lack a lot of the cellular machinery to do so. This is why they have to invade a cell, and use the cells cellular machinery to help the virus replicate.
This is the reason they are not considered living.