22

Or another container type if there's a better one?

My server was originally connected to my TV to run Kodi and play some games while serving files, so it's running Xubuntu. While it works well for the most part, I want to set it up properly, and be able to move the services to a new system when the time comes.

I was thinking that Docker, or another container system, would probably be best, because as well as hopefully being able to be moved, installing new software shouldn't affect anything else.

Am I on the right track? Can containers be moved to another system without needing to be set up again?

I'm running the *arr suite two Java Minecraft servers Plex media server Two copies of qBittorent NZBGet Ombi Mylar Codex and probably some others that I've forgotten.

While I'm at it, is there a best OS to base everything on? Preferably free. The server is a 4th generation i5 with 32GB RAM, and currently about 10TB of HDD space, with a small SSD for boot, and a Quadro graphics card for transcoding.

Thanks in advance :)

all 24 comments
sorted by: hot top controversial new old
[-] mark@social.cool110.xyz 19 points 1 year ago

@Tippon That is a big part of the point behind containers, you don't have any long term state inside them. Migration is just a case of copying the configuration over along with the contents of any persistent volumes.

It's worth looking into Podman instead of Docker, the daemon-less architecture makes it more lightweight and secure as it's easier to have rootless containers. Management can also be easer as being a Red Hat project it integrates well into Systemd.

With your existing server on Xubuntu you may as well stick with Ubuntu Server or Debian for the familiarity.

[-] andruid@lemmy.ml 7 points 1 year ago

Podman also has tooling for deploying containers as systems services or as k8s deploymentments.

[-] Tippon@lemmy.dbzer0.com 2 points 1 year ago

I have no idea what that means! (yet :D).

Time for some research :)

[-] Tippon@lemmy.dbzer0.com 1 points 1 year ago

Brilliant :)

I've just been reading some of the other replies, and, yeah, it looks like containers are the way to go. I've got my data on separate drives, so that's easy enough to deal with, it's just the container side of things that's been confusing me.

I'll have a look at Podman, thanks :)

Like you say, I'm probably better off with a Debian fork, especially as I'm using Mint on my laptop, and should be on my PC if I can find alternatives to a few programs :)

[-] nonprofitparrot@lemmy.world 1 points 1 year ago

I've been working with podman for a few weeks, and it's functional but a bit harder. If you're a noobie I would recommend you stick to docker. If you're a FOSS enthusiast and up for a little more challenge podman is pretty cool.

[-] MangoPenguin@lemmy.blahaj.zone 5 points 1 year ago* (last edited 1 year ago)

Extremely easy if you've set your projects up using docker compose files.

Just copy the compose file and data volumes over to the new host, run docker compose up -d and you're all set.

While I’m at it, is there a best OS to base everything on? Preferably free.

Debian, or Proxmox if you want a webUI for containers and VMs.

[-] Tippon@lemmy.dbzer0.com 1 points 1 year ago

Brilliant, thank you :)

My data is on separate drives, so I can just disconnect and reconnect them when I upgrade. I'm planning on doing the OS first, then eventually the computer.

I'll have a look at Proxmox, thanks :)

[-] shasta@lemm.ee 4 points 1 year ago

The data that your software interacts with is external to a container but can be mapped to the container file system so that the software can interact with it. For example, your Minecraft server relies on disk files consisting of the world state and server config files (and plugins if you have any). These will still be on your host system, not inside the container. In order to transfer this to another system, you have to take those files from your host and move them to the new host. Then copy your docker config files over too so you can start a new container that points to your files on disk and it should function the same as it did before, but possibly with a different IP address.

An easy way to think of it is that a container can be restarted, like maybe when you restart the PC. When a container is restarted, all the files in the container reset to their initial state. If you go into a container and create files then restart the container, those files will be gone. Any data that needs to be persisted between restarts needs to go on your host filesystem and volume mount it to the container.

[-] Tippon@lemmy.dbzer0.com 1 points 1 year ago

Thanks for replying :)

I think I'm starting to understand it a bit better. Your first paragraph explains what I thought a Docker container would be like, except that I wasn't sure whether the Minecraft server would be part of the container or not. I always thought of containers as like a mini OS that just runs the required software, and connects to data outside of the container. This is why I thought they could be moved, like a virtual machine can be moved.

Would I be right in thinking that as long as the config is saved externally, the container can be rebuilt on any system with that config file? If so, that's probably exactly what I need.

My data is currently on separate drives to the OS, so my plan is to replace the installed software, e.g. Radarr, with a containerised version so that everything is in containers where possible, then replace the OS with something more suitable. When the computer eventually gets replaced, I want to be able to start up the containers and be ready to go without having to set up all the software again.

[-] shasta@lemm.ee 2 points 1 year ago

Yes that's correct. And containers are not really portable in the way you described. They do have a mini OS in them but the state is not saved when they are "offline". So you can think of it as more of a template, called an image. You can save the image to a file, and move that to a new pc and load that back into Docker, but that's usually unnecessary. As long as you have Internet, you just need to know the name of the image and Docker will just download it if it doesn't already have it. For most popular programs, you'll find an image for it already created so just follow the instructions on what settings to use for things like volume mounts and environment variables. This configuration of variables can be saved into a Docker Compose file for easy reuse instead of typing really long command line to run your container. This Compose file is all you really need to move to the other PC and it'll just download your image and run everything as before.

[-] Tippon@lemmy.dbzer0.com 2 points 1 year ago

Oh, that's even easier than I thought then :)

I've got a great internet connection, so as long as I save the Compose files, I can rebuild the image forever, barring changes to the program in the container then. Much easier :D

[-] webuge@lemmy.dbzer0.com 2 points 1 year ago

Besides containers, you should look in Ansible too, you can automatize the creation of your infrastructure in other servers.

[-] Tippon@lemmy.dbzer0.com 1 points 1 year ago

I'll have a look, thanks :)

[-] burndown@sh.itjust.works 1 points 1 year ago

Docker is helpful, but won't be perfect since there's no built-in migration. You'll have to move any mounted directories like config and data and stuff. Docker is designed to be able spin up and down constantly, so it doesn't really hold any persistent data in the image itself.

Also, I know you want free, but have you considered unraid? If you really need free you can try truenas or freenas or whatever, but a user friendly linux distro isn't usually going to be too much overhead. I'd highly recommend unraid as a good option for users who need an easier way to work with all of their containers but don't want to go as far as setting up a kubernetes cluster or something.

[-] Tippon@lemmy.dbzer0.com 1 points 1 year ago

Thanks for replying, sorry about the delay in replying back :)

That's a shame about Docker. I haven't used it properly yet, and was under the impression that it works like a virtual machine, so could be moved or cloned to another system.

I've just had a look at Unraid, and while it does look good, it's not right for me for now. My drives are full of media and I can't afford a spare for now (the media is replaceable if anything goes wrong)

[-] MangoPenguin@lemmy.blahaj.zone 4 points 1 year ago

Docker is very easy to migrate, all you do is copy the data and compose file over.

[-] burndown@sh.itjust.works 3 points 1 year ago

What he said ^. There's no automation, you just have to make sure you catch everything is all. I may have made it sound more difficult than I intended, sorry about that!

[-] Tippon@lemmy.dbzer0.com 2 points 1 year ago

No worries, I managed to misunderstand, and explain myself badly in the same post, so I'm certainly not going to give anyone else grief for it :D

Apart from my home directory, most of my data is on separate drives to the OS, and ideally would be staying like that. If I can just transfer the container and config, I'd be happy :)

this post was submitted on 08 Oct 2023
22 points (100.0% liked)

Self Hosted - Self-hosting your services.

11447 readers
28 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules

Important

Beginning of January 1st 2024 this rule WILL be enforced. Posts that are not tagged will be warned and if not fixed within 24h then removed!

Cross-posting

If you see a rule-breaker please DM the mods!

founded 3 years ago
MODERATORS