"affordable" is pretty subjective!
What is your budget?
"<snip>... the server to switch off automatically when uninterruptible power supply running low in energy."
- How long do you want it to run for?
You would choose a UPS by the sever's power supply requirments, then by the UPS's capacity. This will give you amount of time it will last.
If your sever needs 400 W, then a 4KVA UPS should last about 10 hours.
Cost (EUR*) is generally directly proportional to Power (KVA)...
(* or whatever your local currency is)