For this new year, I’d like to learn the skills necessary to self host. Specifically, I would like to eventually be able to self host Nextcloud, Jellyfin and possibly my email server too.

I’ve have a basic level understanding of Python and Kotlin. Now I’m in the process of learning Linux through a virtual machine because I know Linux is better suited for self hosting.

Should I stick with Python? Or is JavaScript (or maybe Ruby) better suited for that purpose? I’m more than happy to learn a new language, but I’m unsure on which is better suited.

And if you could start again in your self hosting journey, what would you do differently? :)

EDIT: I wasn’t expecting all these wonderful replies. You’re all very kind people to share so much with me :)

The consensus seems to be that hosting your own email server might be a lot, so I might leave that as future project. But for Nextcloud and Jellyfin I saw a lot of great tips! I forgot to mention that ideally I would like to have Nextcloud available for multiple users (ie. family memebers) so indeed learning some basic networking/firewalling seems the bare minimum.

I also promise that I will carefully read the manuals!

  • slazer2au
    link
    fedilink
    English
    542 months ago

    Docker really. If something goes bad, trash the container and start again without loosing your actual data.

    • @[email protected]
      link
      fedilink
      English
      122 months ago

      Mostly Docker.

      Portainer and plugging Docker Compose XML into Portainer stacks makes Docker stupid-simple. (personally speaking as a stupid person that does this)

      Cloudflare tunnels for stuff people other than you might want to access.

      Tailscale if it’s only you.

      Reverse proxy & port forwarding for sharing media over Jellyfin without violating the Cloudflare Tunnel ToS.

    • @[email protected]
      link
      fedilink
      English
      4
      edit-2
      2 months ago

      Dokploy is a pretty easy web gui and is itself a docker container.

      Makes it dead simple to manage multiple containers and domains. (Not for power users that need kubernetes level flexibility)

  • Presi300
    link
    fedilink
    English
    412 months ago

    You don’t need to be a programmer to selfhost.

    The most important “skills” to have if you want to selfhost imo are:

    • Basic Networking knowledge

    • Basic Linux knowledge

    • Basic docker/docker compose knowledge

    But I’d say to not get lost in the papers and just jump right in. Imo, the best way to learn how to selfhost is to just… Do it. Most everything is free and fairly well documented

  • NeatoBuilds
    link
    fedilink
    English
    282 months ago

    Learn how to properly backup your data in case you nuke something you shouldn’t

    • @[email protected]
      link
      fedilink
      English
      112 months ago

      And regularly check them. I just found out the hard way this last week that my backups haven’t been running for a few weeks …

      • @[email protected]
        link
        fedilink
        English
        42 months ago

        Yep.

        I have friends in the SMB space, one thing they do is a regular backup verification (quarterly). At that frequency, restoring even a few files (especially to a new VM), is very indicative, especially if it’s a large dataset (e.g. Quickbooks).

        In Enterprise, we do all sorts of validation, depending on the system. Some is performed as part of Data Center operations, some is by IT (those are separate things), some by Business Unit management and their IT counterparts.

        • @[email protected]
          link
          fedilink
          English
          22 months ago

          Unfortunately, that wouldn’t have done anything. Because I did that in December and they stopped running like 2 weeks after my verification. I would have caught it on my next scheduled validation, but that doesn’t help me now 😕

          • @[email protected]
            link
            fedilink
            English
            22 months ago

            I mean, it still helps right? It limits your losses to X weeks instead of X months or, I hate to say it, X years.

      • @[email protected]
        link
        fedilink
        English
        32 months ago

        These 1000% eventually your gonna run into a problem / situation that does not have much documentation. Powering through step by step logically can test the best of us. You can spend 56 hours in a day on one problem. Give up. The next morning figure it out in 10 minutes. It’s a marathon not a sprint.

  • @[email protected]
    link
    fedilink
    English
    112 months ago

    You don’t really need to know a specific language to self-host anything. But things like YAML, JSON, Docker, and some networking basic will go a long way.

    If I could do anything different though, it would definitely be to write more documentation. Document the steps taking setting things up, log notes on when you have to fix something, archive webpages and videos that you used along the way. Currently doing that myself now after some time self-hosting.

    • @[email protected]
      link
      fedilink
      English
      4
      edit-2
      2 months ago

      One under-appreciated aspect of Docker is that it forces you to document all your setup steps in your dockerfile and docker-config files.

  • Avid Amoeba
    link
    fedilink
    English
    11
    edit-2
    2 months ago

    If you want to program something, the closest you’re gonna get to programming is Ansible and Bash scripts.

    You might want to get self hosting hardware like Synology or the like if you’re not ready to dig.

    Otherwise here’s some things you need to know:

    • Docker
      • Easy, consistent deployment of services in their own environments. Think a VM but with almost no overhead.
    • Docker Compose
      • Run docker containers with consistent configuration in files.
      • Connect various containers to each other on the same or different networks.
      • Get multiple containers to start together and talk to each other.
    • Systemd
      • Manage any service on Linux. If anything needs to start on boot, restart when crashed, start on timer, you want Systemd.
      • You can manage your docker compose containers lifecycle via Systemd.
    • NGINX/Apache/Caddy
      • A web server for reverse proxy. You’d probably need one at some point, especially if you want HTTPS. Your services get hidden behind it.
    • ZFS
      • Reliable redundant storage. You’ll need storage. Use ZFS with 2-disk redundancy.
      • Supports automatic snapshots for recovering from oopsies. E.g. deleted something or some software shat on your data.
      • Can use recertified disks from serverpartsdeals.
      • Can use USB disks or USB box with multiple disks. If you end up going the USB route, ask me for tested hardware.
    • Backup system
      • Something to do backup. There are many options.
    • Ansible
      • If you want to write code that describes your services and make them happen, you want Ansible. You write code (well YAML) and Ansible installs things, writes config files, sets up Systemd services, restarts things. It can be convenient especially if you have a lot of stuff and you want to be able to see all of your infrastructure in code in one place and be able to version it.
    • Prometheus
      • Monitoring your stuff. Is my backup service running? If not send me an email.

    Oh and use Debian or Ubuntu LTS.

    • @[email protected]
      link
      fedilink
      English
      4
      edit-2
      2 months ago

      Great summary!

      Why Debian or Ubuntu? (I have my own thoughts, but it would be useful to show even high-level reasons why they’re preferred).

      Re: Backup - Backblaze has a great writeup on backup approach today. I’m a fan of cloud being part of the mix (I use a combo of local replication and cloud, to mitigate different risks). Getting people to include backup from the start will help them long-term, so great you included it!

      • Avid Amoeba
        link
        fedilink
        English
        3
        edit-2
        2 months ago

        Predictable cadence, stable operation, timely updates, huge community and therefore documentation. You can get up to 5 years from an LTS release of Debian or Ubuntu. With Ubuntu LTS and Ubuntu Pro (free) you could theoretically run a machine without upgrading for 10 years. If you run workloads in containers, it doesn’t matter how old the host OS is. As long as it’s security patches, you can keep on trucking.

    • @[email protected]
      link
      fedilink
      English
      32 months ago

      Ansible is nice but I’ll repeat (as I said in another thread) it’s kind of advanced and gives a much better return on investment if you manage several hosts, plan to switch hosts regularly, or plan to do regular rebuilds of the environment.

  • @[email protected]
    link
    fedilink
    English
    102 months ago

    Learning Linux is a great start.

    Learning any coding language will help you understand a bit more about the programs will work, however there isn’t much need to actually learn a specific language unless you plan to add custom programs or scripts.

    The general advice for email is don’t. It’s very risky to host and it’s a big target for spam. Plus there’s challenges getting the big companies to trust your domain.

    However hosting things behind a VPN (or locally on your home network) can let you learn a lot about networking and firewalls without exposing yourself to much risk.

    I have no direct experience with next cloud but I understand it can be hosted on Linux, you can buy a Synology NAS and run it in that, or use something like TrueNAS.

    Personally my setup is on one physical server so I use Proxmox which lets me run 2 different Linux servers and trueNAS on one single computer through virtual machines. I like it because it lets me tinker with different stuff like home assistant and it won’t affect say my adblocker/VPN/reverse proxy. I also use Docker to run multiple services on one virtual machine without compatibility issues. If I started again, I’d probably have gotten bigger drives or invested in SSDs. My NAS is hard drives because of cost but it’s definitely hitting a limit when I need to pull a bunch of files. Super happy with wireguard-easy for VPN. I started with a proprietary version of openVPN on Oracle Linux and that was a mistake.

    • Flax
      link
      fedilink
      English
      2
      edit-2
      2 months ago

      Is there a good way to not self host email yet maintain good control? Like storing it on a local device. I know that addresses are portable with a domain, but still.

      • @[email protected]
        link
        fedilink
        English
        1
        edit-2
        2 months ago

        I personally haven’t explored self hosting mail. This thread is a year old but might give you insight from people who have.

        I’ve heard about using mailbox.org to do what you’re talking about. It seems the general consensus is getting a clean IP mentioned in the thread linked above is the biggest challenge.

        Edit: mailbox isn’t the what I was thinking of. I’ve definitely heard of services that let you self host half of it and just do the send receive part.

    • @[email protected]
      link
      fedilink
      English
      1
      edit-2
      2 months ago

      I feel like objecting to the “General advice about email is don’t” thing but I don’t know if I understand the objections well enough to refute them. I self host email for mspencer.net (meaning all requests including DNS are served from hardware in my living space) and I have literally zero spam and can’t remember the last time I had to intervene on my mail server.

      On one hand: My emails are received without issue by major providers (outlook, gmail, etc) and I get nearly zero spam. (Two spam senders were using legitimate email services, I reported them, and got human-seeming replies from administrators saying they would take care of it.) And I get amusing pflogsumm (summarizes postfix logs) emails daily showing like 5 emails delivered, 45 rejected, with all of the things that were tried but didn’t work.

      On the other: most of the spam prevention comes from greylist, making all new senders retry after a few minutes (because generally a legit MTA will retry while a spammer will not) and that delays most emails by a few minutes. And it was a bear to set up. I used a like 18 step walkthrough on linuxbabe dot com I think, but added some difficulty by storing some use and alias databases on OpenLDAP / slapd instead of in flat files.

      But hey, unlimited mail aliases, and I’m thinking of configuring things so emails bounce if they seem to contain just a notification that terms and conditions are updated somewhere. I don’t know, cause some chaos I guess.

      And I have no idea if my situation is persuasive for anyone because I don’t know what the general advice means. And I worry it’ll have the unfortunate side effect of making self hosting type nerds like me start forgetting how to run their own email, causing control of email to become more centralized. And I strongly dislike that.

  • @[email protected]
    link
    fedilink
    English
    72 months ago
    • Docker: You can practice on your main computer before complicating things with networking.
    • How to set up a reverse proxy: DNS, certificates, etc. I recommend Caddy.
    • Backups: If you use Docker Volumes, make sure you back those up too and test the backups.

    To self-host, you do not need to know how to code.

    • @[email protected]
      link
      fedilink
      English
      32 months ago

      To self-host, you do not need to know how to code.

      I agree but also say that learning enough to be able to write simple bash scripts is maybe required.

      There’s always going to be stuff you want to automate and knowing enough bash to bang out a script that does what you want that you can drop into cron or systemd timers is probably a useful time investment.

  • @[email protected]
    link
    fedilink
    English
    6
    edit-2
    2 months ago

    if you could start again in your self hosting journey, what would you do differently? :)

    That’s an excellent question.

    If I were to start over, the first thing that I would do is start by learning the basics of networking and set up a VPN! IMO exposing services to the public internet should be considered more of an advanced level task. When you don’t know what you don’t know, it’s risky and frankly unnecessary.

    The lowest barrier to entry for a personal VPN, by far, is Tailscale. Automatic internal DNS and clients for nearly any device makes finding services on a dedicated machine really, really, easy. Look into putting a tailscale client right into the compose file so you automatically get an internal DNS records for a service rather than a whole machine.

    From there, play around with more ownership (work) with regard to what can touch your network. Switch from Tailscale’s “trusted” login to hosting your own Headscale instance. Add a PiHole or AdGuard exit node and set up your own internal DNS records.

    Maybe even scrap the magic (someone else’s logic that may or may not be doing things you need) and go for a plain-Jane Wireguard setup.

    • @[email protected]
      link
      fedilink
      English
      32 months ago

      For sure use Tailscale for VPN. They have apps for iPhone, Android, macOS, and Linux, so setting up your own personal network will be easy. Hosting on the real internet is definitely advanced and not always necessary.

  • @[email protected]
    link
    fedilink
    English
    62 months ago

    As others have said, you don’t need to know how to code, but you do need to be comfortable editing structured documents, so knowing a little programming does help.
    Unfortunately, Nextcloud and email are two of the most difficult things to self-host. This is by reputation, I haven’t tried myself. Email is supposed to be particularly difficult and the usual advice is to not bother.
    Jellyfin is pretty straight-forward as long as you don’t have a weird hardware decoding setup and as long as you don’t want remote access. If you do want remote access you need to use third party tools to do it securely. If it’s just for your own use then Tailscale makes it really easy. If you want to share with non-technical users it gets messy.

    • Kaldo
      link
      fedilink
      12 months ago

      I remember reading that tailscale can’t be used for sharing media, was that wrong?

      • @[email protected]
        link
        fedilink
        English
        12 months ago

        Performance may be an issue. It’s not specifically designed for streaming performance, and being a software VPN, it will depend a great deal on the devices used at each end.

      • @[email protected]
        link
        fedilink
        English
        12 months ago

        I believe the issue is only with Tailscale Funnels. With Funnels, the data runs through TS’s infrastructure so it’s subject to whatever kind of bandwidth limitation they feel like enacting.

  • Synapse
    link
    fedilink
    English
    62 months ago

    Take the time to properly understand Linux file ownership and permission. Permission will be the cause of many issues you will encounter in you self-hosting journey on Linux. Make sure you know the basics of chmod (change permission) and chown (change ownership), Linux users and groups. This will save you some head-scratching, but don’t worry, you will learn by doing !

    Remember that, if you setup everything right, especially with docker, running as root / with sudo is not required for any of the services you may want to run.

  • @[email protected]
    link
    fedilink
    English
    52 months ago

    Give Nextcloud AIO a shot. I installed bare metal the first time, but AIO has decreased my maintenance burden to next to nothing. Before that, it felt like every update would break my system. I’m a year or two into my transition from Linux nerd to self-hoster. I still fail at things on occasion, but I have learned a lot. I hope it goes as well or even better for you.

    • @[email protected]
      link
      fedilink
      English
      22 months ago

      I’ve hosted NC for a decade, and the AIO was the first method that doesn’t make me dread updates. And I’ve used pretty much every method of installing it over the years, everything sucked.

      I snapshotted every time before and update because I knew it was a crapshoot whether the update was going to crater the system, and I’d roll back and wait for a working update to come out. Before snapshotting, I had to fix borked updates about every second time.

  • @[email protected]
    link
    fedilink
    English
    52 months ago

    Experimenting with VMs is the way forward.

    Basic networking knowledge is vital. And being able to configure your own firewall(s) safely is an important skill. Check out something like Foomuuri, or Firewald. Shorewall is brilliant for documentation and description of issues (with diagrams!) but it does not use the newer Linux kernel nftables and is no longer actively developed.

    Go for it with Nextcloud.

    I would also recommend at least having a shot at setting up an email server, although I would recommend pushing through to a fully working system. It is possible, and is very satisfying to have in place. The process of setting one up touches so many different parts of internet function and culture that it is worth it even if you don’t end up with a production system. The Workaround.org ISPMail stuff is a good starting point, and includes some helpful background information at every stage, enough so you can begin to understand what’s going on in the background and why certain choices are being made - even if you disagree with the decisions.

    Python is great for server admin, although most server config and startup shutdown snippets are written in BASH. You will no doubt have already begun picking that up as you interact with your VMs.

  • @[email protected]
    link
    fedilink
    English
    5
    edit-2
    2 months ago

    Enough focus to read documentation.

    That’s really it. If your purpose is just self hosting learning bash could also be helpful. And yeah Linux would be a great choice.

    But mostly, if you want to self host an instance of Nextcloud correctly and without having to deal with too many unexpected things, you have to read the documentation and do not rush. Most self hosted stuff isn’t “install and use”, because you’ll be your own server manager, and everything requires attention to be managed.

    Docker or not docker you will have to deal with configuration, settings, requirements and updates.

    So understanding how to read the docs/search and open github issues and taking time to read everything would be the most important skill for me.

    Also writing down what you are doing would indeed be helpful too, in order not to lose track of what you’re doing on your server. (Check out Ansible).

    Most apps out there simply need you to know about permissions, systemctl services and package managers.

    Try to always find a specific package for your distro for everything you install (eg. .deb for Debian), and have strategies when this is not possible (aka using a Python venv when installing python programs).

  • @[email protected]
    link
    fedilink
    English
    52 months ago

    Dude it sounds you’re over skilled for the job. You just need to read some guides and you probably know already how networking works, very basic linux commands, linux folder structures, and then the concept of docker - primarily how it maps networking & folders from your “host machine” to the “docker container”, and how it loads services using a docker compose file. Especially for nextcloud, domain dns management and dynamic dns etc would be very helpful knowledge.

    Also, just a suggestion, chatgpt etc are super useful. You tell them what you want and it spits out custom instructions for your setup, and you’re able to counter question at any point. If it does make mistakes, which it will, it’s a learning opportunity for you to troubleshoot and figure out how everything works. All the best and if you have a question feel free to message me.