It used to be, and buying a few servers was a cheap way to get off the cloud (if you can manage them efficiently). But with RAM and other costs these days... I've had to rethink it a lot.
It's at worst ten times as expensive as it should be. But AWS was already ten to a hundred times as expensive, so even in the computer parts crisis, self hosting is still ahead.