I host Crafty Controller (docker) on my desktop, because it is faster than my server. However, I’d like it for a MC server to be always running, so I don’t need to power on my desktop for anyone to join.

Minecraft runs fine on the server, as long as there aren’t many people on, and aren’t exploring new chunks. Generating new chunks is very cpu intensive, but one person exploring can be fine and is acceptable. However, I want a way to switch the same server to run on my desktop, nice and fast.

So basically, it of the time I want MC running on my server, and then when multiple people are playing (including me) I want to be able to turn off the server, and then turn it back on at my desktop.

I use NPM for my domain and SSL, however it’d be fine if people access at serverIP:port and desktopIP:port. That is acceptable (doesn’t need to be mc.example.com, but would be nice)

Would Syncthing be the tool to use? I could use it to sync the folder of Crafty to each computer…

  • sugar_in_your_tea@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 days ago

    Yeah, I think Syncthing + maybe a port forward should work. So you’d always access it at serverIP:port, but the traffic could be tunneled to your desktop instead if that’s where it’s running. Basically, the process would be:

    1. stop MC on server, start TCP tunnel from server -> desktop
    2. ensure files are copied (maybe Syncthing?)
    3. start MC on desktop

    Then later, reverse the process.

      • sugar_in_your_tea@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        2 days ago

        Use a reverse proxy, like nginx, HAProxy, etc. It’ll listen on your MC server’s port and forward all data to your desktop. Then run either your MC server or the reverse proxy on your server.

        There’s probably something you can do in Tailscale to change what a logical name points to, but this can work as a backup if you can’t figure that out.