Can I install the valve vertically?

Yes.
If possible, install the valve in line with your existing manual shutoff valve.