if you're using plugins, i would recommend NOT using Bukkit, instead use either Paper or Spigot. Spigot is based on Bukkit and provides better plugin support than Bukkit, and Paper is a more optimized version of Spigot. also, if you set EXEC_DIRECTLY=true as an environment variable and enable tty and stdin_open support, you can instead attach to the server (docker attach {container} or click the attach button in portainer) and get a more useful console.
There may be some people who don't realize this. I just started doing this myself, so I didn't. The .yml file cannot have the TAB character in it, you have to use spaces. I got the best luck just using a single space in place of a tab, as opposed to four like you normally would if you can't use tab.
This is great stuff, thank you for this. Clearest explanation I've found yet. Any thoughts on how to extend this to backing up multiple Minecraft server containers, and how to add steps to stop the containers before backing up, and then resuming them once the backups are complete?
Answering my own comment, after some experimentation I added the following to determine whether the server is running or not, and send some Rcon messages to the players to let them know what's happening: # Stop container if it's running CONTAINER_RUNNING=0 if [ "$( docker container inspect -f '{{.State.Running}}' ${CONTAINER} )" == "true" ]; then CONTAINER_RUNNING=1 echo "Container ${CONTAINER} is running, stopping before running the backup..." docker exec ${CONTAINER} rcon-cli --password xxxxx "say 5 Minutes: Just letting you know this server will stop briefly in 5 mins in order to do a backup, it will come back up again after a few minutes. You can carry on playing right up to the point the server shuts down, you don't have to log out." sleep 240 docker exec ${CONTAINER} rcon-cli --password xxxxx "say 1 Minute: Just letting you know this server will stop briefly in 1 minunte in order to do a backup, it will come back up again after a few minutes. You can carry on playing right up to the point the server shuts down, you don't have to log out." sleep 60 docker exec ${CONTAINER} rcon-cli --password xxxxx "say Ok, stopping the server now, should only take a couple of minutes..." sleep 5 docker stop ${CONTAINER} echo "${CONTAINER} stopped, backup starting" else echo "Container ${CONTAINER} is not running, moving straight to backup" fi The point of the 'echo' lines it to capture the output in the backup log referenced on the crontab task. I also added the following to restart the server, if it was running in the first place: # Restart container if it was running before the backup if [[ $CONTAINER_RUNNING = 1 ]] ; then echo "Backup finished, restarting container ${CONTAINER}..." docker start ${CONTAINER} else echo "${CONTAINER} wasn't running before the backup, leaving in down state" fi I created multiple crontab lines to run the backups for each of the servers (currently 5 separate servers, of which 1 or 2 will be running at any one time).
Did you not need to do the -e MEMORY=2G command to make the server use more than the default 1G? I can't for the life of me get the stupid docker working and the truecharts version has no memory settings. other than the normal resource settings all truenas scale apps have, which I don't think have anything to do with the minecraft server settings/ launch parameters.
Hey this might be a dumb question but when trying to install plugins I'm getting an mc-image-helper error saying "Failed to sync and interpolate /plugins into /data/plugins : plugins/plugin-name.jar" Is there anything I need to do with folder/file permissions to make sure this works properly?
Unfortunately in my case the backup script didn't create the zipped docker volume. It didn't throw a error but also wouldn't create the .tar backup file. My quick workaround was to modify the if statement where the $ALL variable is checked for true and then the list of volumes is created. I changed the if statement from "if $ALL ; then" to "if [[ $ALL == true ]] ; then". This fixed my problem and created the .tar backup. I only tested the script for one specified volume but not for the case where you want to backup all volumes.
nice that made me crazy. when i execute the docker run command manual the .tar file was created. But when i run the script it didnt work. Now its working. Thank you.
I can’t scp for some reason it just says something about no permission, I then tried from the same machine to scp it and it didn’t work either I changed the ssh to disable inheritance and I still couldn’t ssh to it (maybe from the other machine? I don’t think It has open ssh) I’m so confused
when the script backup the server, does it create the backup while the server is live or during reboot? if live, i believe it can create issues with the server map files
Thanks for the video. I set this up last week and it has been running great. I am new to Docker and was wondering why the name of the container is "minecraft-minecraft-1"? Note that apparently Docker now uses dashes instead of underscores. Is this because we didn't give the container a name? I would like it to be just "minecraft" for ease of typing. After watching this video, I also setup a Terraria server and it did the same thing. It is named: terraria-terraria-1.
How would the performance be in a windows docker system with 4gb ram capacity? My users connect via their nintendo switch or ios. Is bedrock server system still available today?
I have an issue with my docker minecraft server that has plugins, specifically with EssentialsX, it doesn't save any warps that I setup on a restart, it says it saves in a .tmp file when I create the warp but upon restart or reload, that file seems to get deleted because the warps set disappear
thanks for the Minecraft vid, I just setup Minecraft on ubuntu, I should have watched this first! now to setup minecraft on docker, Glad you got married.....
Attempting to help a friend who followed this guide, how does one access the volume created (or volumes in general) by this guide? While I have years of server experience, I never touched docker. I've looked at a handful of docker docs and don't actually understand how to access the volume created in this guide
@@RaidOwl cheers, I think we checked there (will check again) is there a way to force recreate the volume? Edit: we checked again and the directory doesn't exist. He can take the file tree down to /lib/
It should be in the volume path, if you did it like in the video it may be /var/lib/docker/volumes/minecraftdata/_data (I'm farily new to this so I hope it helps)
When you shut down the Pc which docker is running on, the Minecraft server will also shut down. For a 24/7 set up. 1. You need a Pc (server) which is running 24/7. 2. Install docker on it. 3. Install Minecraft server using this vid.
I'd like to know what the benefit is of doing it this way vs other ways like maybe the way described by Minecraft on their site's documentation. I think I did that but I wrapped the server command to execute in a .bat file.
you kids are funny. as an og nerd i used vi in the 70s, then i used vim, then nano. it's called evolving :P oh, and i'm using a flatscreen instead of a crt nowadays too ;)
I'm new with docker but your demo was very helpful and easy to understand, thank you very much !
if you're using plugins, i would recommend NOT using Bukkit, instead use either Paper or Spigot. Spigot is based on Bukkit and provides better plugin support than Bukkit, and Paper is a more optimized version of Spigot.
also, if you set EXEC_DIRECTLY=true as an environment variable and enable tty and stdin_open support, you can instead attach to the server (docker attach {container} or click the attach button in portainer) and get a more useful console.
Dope! Thanks for tips homie
Thank you. You are the only place I was able to find out how to access the server command line in docker.
“Hell yea let’s do it” Was so good
Thanks... I'm running this on an Orange pi5. My kids are stoked!
This video saved me 7+ years of pain.
There may be some people who don't realize this. I just started doing this myself, so I didn't. The .yml file cannot have the TAB character in it, you have to use spaces. I got the best luck just using a single space in place of a tab, as opposed to four like you normally would if you can't use tab.
Use Visual Studio Code and Docker plugin and you can use tab. The plugin checks for you
Also, the Yaml Lint plugin helps a lot with any YAML syntax and spacing errors
In VSCode you can also just press F1 (Or Ctrl+Shift+P) and type "convert".
Two options should pop up, one to convert Spaces to Tabs and vice versa
As someone who si really new in having a home server, I learned a lot with this video. Thank you
I have watched so many videos and none of this makes sense.
if you specify a filepath instead of a volume, will the script fail? I don't currently have a volume setup for the server I am running
Don’t know if someone else asked but how do we make a modded server?
For those who didn't notice it's:
docker-compose up -d --force-recreate
This is great stuff, thank you for this. Clearest explanation I've found yet. Any thoughts on how to extend this to backing up multiple Minecraft server containers, and how to add steps to stop the containers before backing up, and then resuming them once the backups are complete?
Answering my own comment, after some experimentation I added the following to determine whether the server is running or not, and send some Rcon messages to the players to let them know what's happening:
# Stop container if it's running
CONTAINER_RUNNING=0
if [ "$( docker container inspect -f '{{.State.Running}}' ${CONTAINER} )" == "true" ]; then
CONTAINER_RUNNING=1
echo "Container ${CONTAINER} is running, stopping before running the backup..."
docker exec ${CONTAINER} rcon-cli --password xxxxx "say 5 Minutes: Just letting you know this server will stop briefly in 5 mins in order to do a backup, it will come back up again after a few minutes. You can carry on playing right up to the point the server shuts down, you don't have to log out."
sleep 240
docker exec ${CONTAINER} rcon-cli --password xxxxx "say 1 Minute: Just letting you know this server will stop briefly in 1 minunte in order to do a backup, it will come back up again after a few minutes. You can carry on playing right up to the point the server shuts down, you don't have to log out."
sleep 60
docker exec ${CONTAINER} rcon-cli --password xxxxx "say Ok, stopping the server now, should only take a couple of minutes..."
sleep 5
docker stop ${CONTAINER}
echo "${CONTAINER} stopped, backup starting"
else
echo "Container ${CONTAINER} is not running, moving straight to backup"
fi
The point of the 'echo' lines it to capture the output in the backup log referenced on the crontab task. I also added the following to restart the server, if it was running in the first place:
# Restart container if it was running before the backup
if [[ $CONTAINER_RUNNING = 1 ]] ; then
echo "Backup finished, restarting container ${CONTAINER}..."
docker start ${CONTAINER}
else
echo "${CONTAINER} wasn't running before the backup, leaving in down state"
fi
I created multiple crontab lines to run the backups for each of the servers (currently 5 separate servers, of which 1 or 2 will be running at any one time).
"it doesn't seem that running a Minecraft server really too hardware intensive" ... me allocating 20gb of ram so my network doesn't implode over here
well, I get errors in the yaml text when I try to start it up... not happy with this.
Did you not need to do the -e MEMORY=2G command to make the server use more than the default 1G? I can't for the life of me get the stupid docker working and the truecharts version has no memory settings. other than the normal resource settings all truenas scale apps have, which I don't think have anything to do with the minecraft server settings/ launch parameters.
I'm in a similar predicament, did you manage to figure this out, cause im kinda stuck atm.
Is there a way to connect to the server off network and on consoles?
Hey this might be a dumb question but when trying to install plugins I'm getting an mc-image-helper error saying "Failed to sync and interpolate /plugins into /data/plugins : plugins/plugin-name.jar"
Is there anything I need to do with folder/file permissions to make sure this works properly?
Me indica error con el servidor pero por no poder verificar el nombre de usuario, como se puede configurar esa parte?
Running Java Minecraft so soon after the Log4j vulnerability release. I too like to live dangerously.
It’s running in the same VLAN as all my Nic Cage fanfics…we’re safe
The vulnerability is patched
Great Content.. Keep up the good work..I'm gonna try this for sure ..
Unfortunately in my case the backup script didn't create the zipped docker volume. It didn't throw a error but also wouldn't create the .tar backup file.
My quick workaround was to modify the if statement where the $ALL variable is checked for true and then the list of volumes is created.
I changed the if statement from "if $ALL ; then" to "if [[ $ALL == true ]] ; then". This fixed my problem and created the .tar backup.
I only tested the script for one specified volume but not for the case where you want to backup all volumes.
nice that made me crazy. when i execute the docker run command manual the .tar file was created. But when i run the script it didnt work. Now its working. Thank you.
Thank you mate you fixed my same issue
How do you go about making this multiplayer as in someone outside of your home playing?
I can’t scp for some reason it just says something about no permission, I then tried from the same machine to scp it and it didn’t work either I changed the ssh to disable inheritance and I still couldn’t ssh to it (maybe from the other machine? I don’t think It has open ssh) I’m so confused
when the script backup the server, does it create the backup while the server is live or during reboot? if live, i believe it can create issues with the server map files
One question you have do one or two volumes because of plugins
Thanks for the video. I set this up last week and it has been running great. I am new to Docker and was wondering why the name of the container is "minecraft-minecraft-1"? Note that apparently Docker now uses dashes instead of underscores. Is this because we didn't give the container a name? I would like it to be just "minecraft" for ease of typing. After watching this video, I also setup a Terraria server and it did the same thing. It is named: terraria-terraria-1.
Yep you can add the name in your compose file
How would the performance be in a windows docker system with 4gb ram capacity? My users connect via their nintendo switch or ios. Is bedrock server system still available today?
I have an issue with my docker minecraft server that has plugins, specifically with EssentialsX, it doesn't save any warps that I setup on a restart, it says it saves in a .tmp file when I create the warp but upon restart or reload, that file seems to get deleted because the warps set disappear
Very good. This video is very good
Thanks nerd. Kids are gonna love the Xmas present.
Hard mode for sure
Hi, I want to add voice chat mod where it needs to use port 24454 upd. How do I config that?
thanks for the Minecraft vid, I just setup Minecraft on ubuntu, I should have watched this first! now to setup minecraft on docker, Glad you got married.....
helpful but can you tell me how to turn off online mode?
Thank you I'm using pterodactyl and couldn't figure out how to access my minecraft folders to change mod configs appreciate you
Attempting to help a friend who followed this guide, how does one access the volume created (or volumes in general) by this guide? While I have years of server experience, I never touched docker. I've looked at a handful of docker docs and don't actually understand how to access the volume created in this guide
Check in /var/lib/docker/volumes on your host
@@RaidOwl cheers, I think we checked there (will check again) is there a way to force recreate the volume?
Edit: we checked again and the directory doesn't exist. He can take the file tree down to /lib/
@@TheBinklemNetwork You can do: docker volume inspect minecraftdata to see the path
Thanks! @@wcellon
I have done all the steps corectly but when I run the command docker-compose up -d --force-recreate it does not show up in portainer. any suggestions?
Feel free to join the discord and we can help over there
Thank you
which ip should i put?
09:40
how can i modify the server.properties file? i can't find any minecraftserver file neither the server.properties
It should be in the volume path, if you did it like in the video it may be /var/lib/docker/volumes/minecraftdata/_data (I'm farily new to this so I hope it helps)
r/riskyclick
what if I have a windows server?
Do i have to install rcon cli separately?
Nope
🤔 my portainer kung-fu is weak. Did I see there is a place you can cut n paste the compose file contents? Then portainer will create the container?
Yep go into App Templates > Custom Templates > Add Custom Template
Please help, when trying to access the server cli I encounter a RCON error: Failed to connect to RCON serverdial connect: connection refused
How to install fabric server
does it run for 24/7 if we close our pc?
When you shut down the Pc which docker is running on, the Minecraft server will also shut down.
For a 24/7 set up.
1. You need a Pc (server) which is running 24/7.
2. Install docker on it.
3. Install Minecraft server using this vid.
I'd like to know what the benefit is of doing it this way vs other ways like maybe the way described by Minecraft on their site's documentation. I think I did that but I wrapped the server command to execute in a .bat file.
And how do i put mods in it?
I would also like to know
Was able to make a Modded Fabric Server work with just a few changes.
hey, can you share the yml file for it?
@@kypac99 not sure how to share to youtube
it's saying permission denied
how can someone outside my network connect?
you need to configure port forwarding in your router using the mc servers ip and port
How to get open ssh client ?
did you manage to open the ssh?
Pinecraft would have made your life easier, although this is still great content and a cool idea.
Yeah there are def one-stop-shops out there but I wanted to do it the vanilla way to learn a more about docker and setting up custom backups.
16:15..
Dude..
A true nerd does not publicly admit to using "nano".
"nano" is for lame people. ;-]
Don’t tell me you use vim 😳
@@RaidOwl its vim or death
@@RaidOwl
The YT bot is very sensitive to everything and does not let my comment through which is why I did not reply.
@@AdrianuX1985 thats weird..
you kids are funny. as an og nerd i used vi in the 70s, then i used vim, then nano. it's called evolving :P oh, and i'm using a flatscreen instead of a crt nowadays too ;)
gross u use guis 🤢
Yum guis