TLDR: In this modern age, the most affordable practical bulletproof "won't get fired for recommending this" solution is a Tesla PowerWall or competitor. The "cheap at all costs" solution is a bank of batteries and a DC PSU (or if the server doesn't support that, an inverter). Gen and UPS solutions are simply not made for this, and force-fitting them will result in an ugly, high-maintenance misfit.
You don't want a UPS, per se
Because your requirement is for a 4-hour runtime, and that is not what UPSs do.
In fact, you really need to throw the book out, because new tech is here that solves the problem much more artfully than enormous UPSs or hokey generators.
Just look at the sizing of UPS's, as jonathanjo talks about - comparing their KW rating vs the number of minutes of power at that rating. Most of them are sized for ~10 minutes of runtime at rating. Just enough time for the bog-standard application of UPSs:
- Ride for 20 sec. in case power comes right back (why shut down needlessly). Then,
- signal the PC that it's time to shut down. The PC then
- stops accepting new connections
- wraps up existing connections
- flushes database writes
- flushes disk cache
- gives some seconds for hard drives to flush internal cache
- completes an orderly shutdown.
That is not what you want. You want to continue business as usual across an extended outage. You need a completely different product family for that.
When you try to force a UPS solution, you find the only way you can "buy" extended battery life is to get an insanely oversized inverter, and that's a game of diminishing returns, because bigger inverters have bigger standby losses, especially at a tiny fraction of rated load. Like the 10kw, $7000 inverter discussed (as a bad fit) by jonathanjo.
Also, UPSs use cheap lead-acid batteries, that have poor service life, and regardless, should not be dipped below about 30% DoD on a regular basis. (DoD=Depth of Discharge; 0%=full 100%=stone dead and damaged) This is an unfortunate characteristic of lead-acid batteries. So if the advertised 1KW runtime of the UPS is 13.3 hours, 30% happens at 4 hours. So you're actually looking for a 13.3 hour runtime, in lead-acid. That is a huge and stupendously expensive battery to be changing every 3 years.
Again, UPSs are just wildly inappropriate here because of the long runtime.
The 1980s era solution
Is a genny, transfer switch, UPS to bridge the gap, etc.
An automatic transfer switch detects the outage, calls for a generator to auto-start and spin up, then it automatically throws the transfer switch. However, this takes a minute or two, so you still need a UPS in the mix to carry the system for that time.
For a quality auto-startable generator with automatic transfer switch, wired in properly into a subpanel and all that, you're north of US$5000; and you still need a UPS also (albeit a modest one).
And worse, you now have 2 batteries to maintain: the UPS battery, and the generator start battery. Another failure point is fuel: if someone failed to top up the tank after the last time, you either get no-start or it quits after an hour.
It's much messier if you try to pinch pennies with a manual generator. Now your UPS must have a much longer battery - 30 minutes to give the crews 5-15 minutes to get the generator fueled, started, extension cords run and the UPS plugged into it -- and still have time for an orderly server shutdown if that doesn't happen. The longer the batteries must run, the more sensitive the UPS is to old lead-acid batteries with shrinking capacity. It might be a good policy to prophylactically change the lead-acid batteries every year or 18 months. SO we save some money but we spend more elsewhere. Ugly, ugly solution.
All in all, I consider generators to be an expensive and/or messy solution. We only consider them because nothing better exists, or to be more precise, existED.
The modern solution: commercial products
Tesla PowerWall and competitors.
When SuperStorm Sandy hit the American northeast, thousands of solar panel owners found out grid-tied solar inverters don't work when the grid is down. This lit off a variety of solutions for extended runtime off-grid backup power. These systems are designed exactly to provide low-draw (1kw-ish) loads for hours and hours. Which fits your use-case like a glove. *These things are new, which is why they're not everyone's first recommendation (and also considered "green" which has a liberal tone which some find distasteful).
The flagship product, of course, is the Tesla PowerWall. Let's take the new PowerWall 2, which tickets at US$7500 all-in, and has 13.5 kwh of power. So it'll run your 1kw load for (realistically) 11 hours. That's too big.
Try the original PowerWall for US$4000 all-in (cheaper still used), and get about 6 hours. Tesla has already "de-rated" the battery to avoid bottoming the lithium battery, so you can really get 6 hours reliably.
Now, remember that 10kw UPS that cost $7000 and only had a 2.5 hour runtime @ 1 KW (which did bottom the lead-acid battery, so really, only 40 minutes daily runtime)? LOL! This certainly illustrates what a misfit it was. Simply the wrong tool for the job. Tesla goes 10 x longer for 1/2 the price, and is lithium to boot.
Further, you can expect 15 years of useful use out of this battery, because Tesla has deep experience (and skin in the game, due to how Tesla car batteries are warranteed) at making lithium battery packs last a long time. The protective circuits are tip top.
Of course there are other manufacturers making PowerWall-like's.
It's funny, PowerWalls and UPSs contain the same nuts and bolts (batteries+inverters+chargers)... but they are sized very differently. That makes all the difference in the world.
By the way, I never mentioned solar panels; some of those systems will support bolting on a simple solar array. That could stretch your runtime while grid is down.
The modern solution: Homebrew on the cheap
The PC runs off batteries normally and constantly. When available, grid power tops up batteries and feeds the PC.
The first step here is see if you can obtain a low-voltage PSU for that server - one that intakes 12, 24, or 48 VDC from a battery - the kind you use in DC-based server farms. If it does, then you can eliminate AC-DC conversion losses in both directions. Otherwise, you will need an inverter rated for continuous use, e.g. 2kw.
Now, you lay up a bank of batteries big enough for your needs. You can go a couple of ways. You can go with lithium arrays such as a 25V/220AH pack out of a Tesla Model S, typically $1500. That'll get you 5.5KWH, and since you can deep-dip lithiums down to 75% DoD, you can safely get 4 KWH out of this. Exactly what you need.
Or, you can go lead-acid, remembering to derate for 30% DoD for daily use, so 13.3 KWH. Take a generic US$100 Interstate golf cart battery: 6 volts @ 210 AH = 1260 AH; ten of those and Bob's your uncle. Needless to say, you acquire lead-acid batteries locally; they are commodities available everywhere; shipping them is not even stupid.
That's it; that's your system; a server and a bank of batteries to power it. Except we add one more thing: a power supply/battery charger that replenishes it while the grid is up. So when the grid is up (say: 3/4 of the time), the charger powers the inverter, and tops up the battery if it needs that. When the power fails, the battery is already connected to the inverter/PC, and picks up the load seamlessly. The PC is not aware a change occurred.
"PC not knowing" is worth some attention. You may want to add a circuit to warn the PC when it passes 50% DoD, so it can blast out a 15-minute warning to wrap up your work, then do an orderly shutdown as per section 1.