Highly suggest placing the UV in a position easily accessible to open to remove and replace bulb without disconnecting from pvc system. I love our Pentair UV sterilizers, but I would never put them in a cabinet upright if we could not remove the bulbs from the housing easily. Servicing is easier with easier access especially for lazy reefers like myself. Pentairs can be turned if space is tight. We have ours positioned so we can literally open it up to service without cutting flow and without taking apart the plumbing. BRS has some good videos. There are also brackets to use to suspend and/or secure the sterilizer. Running the Pentair off the main pump and using ball valves is a good way to control flow. We use a ball valve for intake to the UV, and flow it back into sump at the return because that is the way Emperor Aquatics -who originally designed the Pentairs- recommended. But, many folks believe in a closed loop to the tank or plumb like you drew direct back to the tank. Many different schools of thought and depends on how you want to use the UV. We also limit UV time and don’t run 24/7 unless there is a specific issue. Too much of a good thing can cause issues too. You might find your set up limiting to your control for the time of the water in the UV to whatever gph you need to run for the tank return which might not be the most effective way to deal with different issues. Different gph flow rates are needed for algae blooms versus parasite killing versus bacterial blooms etc…. And a tank needs consistent flow and water boxes are designed for specific flow rates. So, depending on what you want and how you want the unit to function, that would effect your plumbing design and placement.