Server shutting down

I have a server running on a raspberry pi but whenever I close my ssh session, the server goes down.