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.
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.
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.
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?
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
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?
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/
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.....
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
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
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.
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.
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 ;)