The only way to keep a server running 24/7 is if you afk on the server without disconnecting. However, i wouldn't suggest doing so, keeping your server online for a long period of time could cause a massive amount of lag. If you were to do anything involving it being up 24/7, make sure you have a restart periodically.