Minecraft Server in Docker - How to Setup/Backup/Restore your Minecraft Server

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • НаукаНаука

Комментарии • 95

  • @neo924
    @neo924 2 года назад +12

    I'm new with docker but your demo was very helpful and easy to understand, thank you very much !

  • @HecUnderscore
    @HecUnderscore 2 года назад +23

    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.

    • @RaidOwl
      @RaidOwl  2 года назад +4

      Dope! Thanks for tips homie

  • @meatpixel256
    @meatpixel256 Год назад +2

    Thank you. You are the only place I was able to find out how to access the server command line in docker.

  • @TripOnSpot
    @TripOnSpot 2 года назад +6

    “Hell yea let’s do it” Was so good

  • @dustind9242
    @dustind9242 Год назад +1

    Thanks... I'm running this on an Orange pi5. My kids are stoked!

  • @AtomicDrago
    @AtomicDrago 6 месяцев назад +1

    This video saved me 7+ years of pain.

  • @nightseer1663
    @nightseer1663 Год назад +14

    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.

    • @DragoSpiro98
      @DragoSpiro98 Год назад +5

      Use Visual Studio Code and Docker plugin and you can use tab. The plugin checks for you

    • @joea2484
      @joea2484 Год назад

      Also, the Yaml Lint plugin helps a lot with any YAML syntax and spacing errors

    • @randoguy7488
      @randoguy7488 11 месяцев назад +1

      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

  • @chumakov
    @chumakov 2 года назад

    As someone who si really new in having a home server, I learned a lot with this video. Thank you

  • @arcaneklownz9081
    @arcaneklownz9081 Год назад +9

    I have watched so many videos and none of this makes sense.

  • @0xfourfive
    @0xfourfive 2 года назад +2

    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

  • @MR.Peanut2
    @MR.Peanut2 Год назад +2

    Don’t know if someone else asked but how do we make a modded server?

  • @DamoclesMedia
    @DamoclesMedia 2 года назад +2

    For those who didn't notice it's:
    docker-compose up -d --force-recreate

  • @iamabes1
    @iamabes1 Год назад +2

    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?

    • @iamabes1
      @iamabes1 Год назад +3

      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).

  • @Baezor
    @Baezor 3 месяца назад +2

    "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

  • @couzin2000
    @couzin2000 Год назад +1

    well, I get errors in the yaml text when I try to start it up... not happy with this.

  • @donkey7921
    @donkey7921 2 года назад +2

    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.

    • @EyeFullBlooD
      @EyeFullBlooD 11 месяцев назад +1

      I'm in a similar predicament, did you manage to figure this out, cause im kinda stuck atm.

  • @GrahamMessadieh
    @GrahamMessadieh 2 года назад +1

    Is there a way to connect to the server off network and on consoles?

  • @gabezerbe9092
    @gabezerbe9092 Год назад

    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?

  • @josejoelramostanca4897
    @josejoelramostanca4897 3 месяца назад

    Me indica error con el servidor pero por no poder verificar el nombre de usuario, como se puede configurar esa parte?

  • @virtualink5
    @virtualink5 2 года назад +17

    Running Java Minecraft so soon after the Log4j vulnerability release. I too like to live dangerously.

    • @RaidOwl
      @RaidOwl  2 года назад +17

      It’s running in the same VLAN as all my Nic Cage fanfics…we’re safe

    • @uniqueprogressive9908
      @uniqueprogressive9908 Год назад +7

      The vulnerability is patched

  • @OschannelDotCom
    @OschannelDotCom 2 года назад +1

    Great Content.. Keep up the good work..I'm gonna try this for sure ..

  • @silverfishseagrass
    @silverfishseagrass 2 года назад +5

    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.

    • @TheDarkextasy
      @TheDarkextasy Год назад +1

      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.

    • @Scooter_213
      @Scooter_213 2 месяца назад +1

      Thank you mate you fixed my same issue

  • @MrAdamseslar
    @MrAdamseslar 4 месяца назад

    How do you go about making this multiplayer as in someone outside of your home playing?

  • @YHK_YT
    @YHK_YT 5 месяцев назад

    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

  • @freakshowboy9
    @freakshowboy9 8 месяцев назад

    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

  • @walter77gamer
    @walter77gamer Год назад

    One question you have do one or two volumes because of plugins

  • @wcellon
    @wcellon 6 месяцев назад

    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.

    • @RaidOwl
      @RaidOwl  6 месяцев назад +1

      Yep you can add the name in your compose file

  • @romeo2417
    @romeo2417 4 месяца назад

    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?

  • @everettcass7904
    @everettcass7904 Год назад

    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

  • @desocietate9135
    @desocietate9135 Год назад

    Very good. This video is very good

  • @phillipmartinez583
    @phillipmartinez583 2 года назад +2

    Thanks nerd. Kids are gonna love the Xmas present.

    • @RaidOwl
      @RaidOwl  2 года назад +2

      Hard mode for sure

  • @aihereplia
    @aihereplia Год назад

    Hi, I want to add voice chat mod where it needs to use port 24454 upd. How do I config that?

  • @gumshoe-tech
    @gumshoe-tech Год назад

    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.....

  • @kiaan00008
    @kiaan00008 8 месяцев назад

    helpful but can you tell me how to turn off online mode?

  • @gannonbest7251
    @gannonbest7251 2 года назад

    Thank you I'm using pterodactyl and couldn't figure out how to access my minecraft folders to change mod configs appreciate you

  • @TheBinklemNetwork
    @TheBinklemNetwork Год назад +1

    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
      @RaidOwl  Год назад +1

      Check in /var/lib/docker/volumes on your host

    • @TheBinklemNetwork
      @TheBinklemNetwork Год назад

      @@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/

    • @wcellon
      @wcellon 6 месяцев назад +1

      @@TheBinklemNetwork You can do: docker volume inspect minecraftdata to see the path

    • @TheBinklemNetwork
      @TheBinklemNetwork 6 месяцев назад

      Thanks! ​@@wcellon

  • @LOFMUSCiLIVESTREAM
    @LOFMUSCiLIVESTREAM Год назад

    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?

    • @RaidOwl
      @RaidOwl  Год назад

      Feel free to join the discord and we can help over there

  • @oSpecialx
    @oSpecialx 5 месяцев назад

    Thank you

  • @kacpergurtowski3644
    @kacpergurtowski3644 Год назад

    which ip should i put?
    09:40

  • @sodhu4478
    @sodhu4478 2 года назад

    how can i modify the server.properties file? i can't find any minecraftserver file neither the server.properties

    • @chumakov
      @chumakov 2 года назад

      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)

    • @ballsuckervr
      @ballsuckervr 4 месяца назад

      r/riskyclick

  • @MrZeval
    @MrZeval Год назад

    what if I have a windows server?

  • @darienverdugo290
    @darienverdugo290 Год назад

    Do i have to install rcon cli separately?

  • @CampRusso
    @CampRusso Год назад

    🤔 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?

    • @RaidOwl
      @RaidOwl  Год назад +1

      Yep go into App Templates > Custom Templates > Add Custom Template

  • @bruhmaster4207
    @bruhmaster4207 Год назад

    Please help, when trying to access the server cli I encounter a RCON error: Failed to connect to RCON serverdial connect: connection refused

  • @zyra337
    @zyra337 2 года назад

    How to install fabric server

  • @nerolized1209
    @nerolized1209 2 года назад +1

    does it run for 24/7 if we close our pc?

    • @arkarin0135
      @arkarin0135 2 года назад +1

      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.

  • @kreakdore
    @kreakdore Год назад

    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.

  • @savekillqqpsounds8473
    @savekillqqpsounds8473 Год назад

    And how do i put mods in it?

  • @williamstickles6062
    @williamstickles6062 3 месяца назад

    Was able to make a Modded Fabric Server work with just a few changes.

    • @kypac99
      @kypac99 Месяц назад

      hey, can you share the yml file for it?

    • @williamstickles6062
      @williamstickles6062 Месяц назад +1

      @@kypac99 not sure how to share to youtube

  • @cruelness55
    @cruelness55 Год назад +1

    it's saying permission denied

  • @abdulkadireraslan2330
    @abdulkadireraslan2330 Год назад

    how can someone outside my network connect?

    • @Bardum22
      @Bardum22 Год назад

      you need to configure port forwarding in your router using the mc servers ip and port

  • @neal-047
    @neal-047 2 года назад

    How to get open ssh client ?

  • @NicMG
    @NicMG 2 года назад

    Pinecraft would have made your life easier, although this is still great content and a cool idea.

    • @RaidOwl
      @RaidOwl  2 года назад

      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.

  • @AdrianuX1985
    @AdrianuX1985 2 года назад +3

    16:15..
    Dude..
    A true nerd does not publicly admit to using "nano".
    "nano" is for lame people. ;-]

    • @RaidOwl
      @RaidOwl  2 года назад +1

      Don’t tell me you use vim 😳

    • @HecUnderscore
      @HecUnderscore 2 года назад +3

      @@RaidOwl its vim or death

    • @AdrianuX1985
      @AdrianuX1985 2 года назад

      @@RaidOwl
      The YT bot is very sensitive to everything and does not let my comment through which is why I did not reply.

    • @RaidOwl
      @RaidOwl  2 года назад

      @@AdrianuX1985 thats weird..

    • @JHess
      @JHess 2 года назад +4

      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 ;)

  • @Patryc
    @Patryc 2 года назад

    gross u use guis 🤢