Server port closes

Ubuntu 22.04
VM
Once I run the start command in terminal it shows running and the game works.
But as soon as that specific terminal is closed, the server is unable to connect and the port closes.
I guess I’m asking, is there a way to auto run that script on boot? Or is there a way to have that run in the background, and not require me to open my vm directly to start the server. If I SSH into the vm it will close the server as soon as I exit the SSH.

New here and hope my first post was detailed enough.
Thanks, Mattatat25