Auto start/stop server when players connect {Pterodactyl} {Ubuntu Server} {Paper Server}

Can anyone help me on how I would set this up for my server I use pterodactyl: https://youtu.be/WqvQISpr6-s?si=d1-i79xv-C0IUVEP
TroubleChute
YouTube
Minecraft: Auto start/stop server when players connect | SleepingSe...
Running a server all the time? Well, you can keep it completely off, and when a player attempts to connect to the server it will startup. After some time passes with no players on the server, it shuts down, waiting for the next player to connect. This way you can always "keep a server running", but only have it use RAM/CPU when there are players...
25 Replies
Admincraft Meta
Admincraft Metaβ€’6mo ago
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close !close !solved !answered
Requested by h_x_c#0
Jenkins
Jenkinsβ€’6mo ago
Why do you want this?
γƒ„π‡α”°π—Ώπ˜€π—΅π“’ΓΈπ”ͺπ”ŸoΖΌ0ΖΌ48
So that the pc's recources are free when no one is connected
Dannyx
Dannyxβ€’6mo ago
I think mcsleepingserverstarter even has a pterodactyl egg
Dannyx
Dannyxβ€’6mo ago
GitHub
mcsleepingserverstarter/docs/egg-paper-mcsleepingserverstarter.json...
Put your minecraft server to rest, while SleepingServerStarter is watching ! - vincss/mcsleepingserverstarter
Dannyx
Dannyxβ€’6mo ago
just import this egg into pterodactyl and create a server with it
Dannyx
Dannyxβ€’6mo ago
So in pterodactyl, you have so-called eggs, they are like small files which tell the panel what type of server it is, how to install the server, how to start it etc. You need to download the file I mentioned and import it as an egg. Then you can create a server using it
γƒ„π‡α”°π—Ώπ˜€π—΅π“’ΓΈπ”ͺπ”ŸoΖΌ0ΖΌ48
so under nests I import egg then I just do save then server create new nest as minecraft and egg as the Paper (mcsleepingserverstarter) and leave the rest as default startup command should be (./mcsleepingserverstarter-linux)? cant I just edit my server I already have tho?
Dannyx
Dannyxβ€’6mo ago
yes as the program runs on javascript, you'd need to change a lot of things for your server, it would be easier to create a new one and copy all of the files over to the new one
γƒ„π‡α”°π—Ώπ˜€π—΅π“’ΓΈπ”ͺπ”ŸoΖΌ0ΖΌ48
I assume it will then auto start as soon as someone connects and then I just have to install the plugin that stops the server when no one is connected?
Dannyx
Dannyxβ€’6mo ago
yes exactly
Skullians
Skulliansβ€’6mo ago
GitHub
GitHub - gekware/minecraft-server-hibernation-pterodactyl-egg: egg ...
egg for gekware/minecraft-server-hibernation. Contribute to gekware/minecraft-server-hibernation-pterodactyl-egg development by creating an account on GitHub.
Snow Kit
Snow Kitβ€’6mo ago
is the issue ram or cpu usage? Minecraft shouldn't use much cpu when nobody is online
γƒ„π‡α”°π—Ώπ˜€π—΅π“’ΓΈπ”ͺπ”ŸoΖΌ0ΖΌ48
No issue really just good to have resources free and having the server shut down if no one is connected making sure nothing can go wrong since power outages are common here
Snow Kit
Snow Kitβ€’6mo ago
minecraft autosaves every 5 minutes, so there's no issues with the server crashing and wouldn't the machine need the resources free anyways if someone wanted to join?
γƒ„π‡α”°π—Ώπ˜€π—΅π“’ΓΈπ”ͺπ”ŸoΖΌ0ΖΌ48
So what happens when it auto saves at the 5 min mark and then it crashes does it revert to the 5 min mark auto save?
ProGamingDk
ProGamingDkβ€’6mo ago
by default you will max loose 5 minutes of data and thats if it crashes on autosave
γƒ„π‡α”°π—Ώπ˜€π—΅π“’ΓΈπ”ͺπ”ŸoΖΌ0ΖΌ48
So there is no real way or "small change" to lose data if the power just cuts instant?
ProGamingDk
ProGamingDkβ€’6mo ago
max 5 minutes, you can even reduce it to quicker
Snow Kit
Snow Kitβ€’6mo ago
most of the time if the game crashes it'll still save only power cuts or linux OOM killing the process will actually cause it to rollback
γƒ„π‡α”°π—Ώπ˜€π—΅π“’ΓΈπ”ͺπ”ŸoΖΌ0ΖΌ48
Ok then another question if no one is connected are chuncks still loaded because looking at it without anyone online ram sits at 22% is there a way to so to say Pause the game or to deload things?
Snow Kit
Snow Kitβ€’6mo ago
because of how java works, once the server allocates memory, it can't be deallocated without the java process exiting
γƒ„π‡α”°π—Ώπ˜€π—΅π“’ΓΈπ”ͺπ”ŸoΖΌ0ΖΌ48
πŸ‘ Ok I would feel safer if the server is off when no one is connected but I guess it does not seem like a problem !close
Admincraft Meta
Admincraft Metaβ€’6mo ago
post closed!
The post/thread has been closed!
Requested by h_x_c#0

Did you find this page helpful?