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!

  • @dontblink@feddit.it
    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).

    • Possibly linux
      link
      fedilink
      English
      12 months ago

      Ansible will be really hard without Linux knowledge

      Maybe do that later

  • @AMillionMonkeys@lemmy.world
    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?

      • @AMillionMonkeys@lemmy.world
        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.

      • @Onomatopoeia@lemmy.cafe
        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.

  • @rumba@lemmy.zip
    link
    fedilink
    English
    62 months ago

    Honestly, you just need to pick a video on follow along these days. There’s a load of YouTube videos out there that take you step by step.

    Lewis rosman recently put out a 14-hour mega video of doing everything, well he might have made some controversial choices, The outcome is quite comprehensive.

      • @OhVenus_Baby@lemmy.ml
        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.

  • Presi300
    link
    fedilink
    English
    452 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

  • @electric_nan@lemmy.ml
    link
    fedilink
    English
    32 months ago

    I don’t know a bit about programming. Yunohost is a great place to start for self hosting a variety of services. For Jellyfin/downloading, I use Swizzin Community Edition. I like both of these projects because neither uses Docker lol. I tried some Docker based setups but could never get my head around it. YMMV.

  • @nnullzz@lemmy.world
    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.

    • @AbouBenAdhem@lemmy.world
      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.

  • Synapse
    link
    fedilink
    English
    72 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.

    • @iopq@lemmy.world
      link
      fedilink
      English
      22 months ago

      It really depends. I actually needed to learn a bit about networking to be able to host multiple things on nginx on the same port. Internally they run on different ports, but they can get routed by the host name

    • @habitualTartare@lemmy.world
      link
      fedilink
      English
      22 months ago

      Setting up jellyfin, I used docker on debian, and an old Quadro card. What could possibly go wrong?

      Turns out that week the Nvidia drivers got a faulty update pushed to debian stable and caused an error with getting the GPU to work in any container. I could either wait a week or pull the simple fix from testing. So impatiently I pulled it from testing.

  • sylver_dragon
    link
    fedilink
    English
    22 months ago

    Along with the things others have said (Backups, Linux, Docker, Networking) I’d also recommend getting comfortable with server and network security. A lot of this is wrapped up in the simple mantra “install your goddamn updates!” But, there is more to it than that. For example, if you go with Nextcloud, read through their hardening guide and seriously consider implementing all of the recommendation. Also think through how you intend to manage both the server and instance. If this is all local, then it is easier as you can keep SSH access to the server firewalled off from the internet. If you host part of your stuff “in the cloud”, you’ll want to start looking at limiting down access and using keys to login (which is good practice for all situations). Also, never use default credentials. You may also want to familiarize yourself with the logs provided by the applications and maybe setup some monitoring around them. I personally run Nextcloud and I feed all my logs into Splunk (you can run a free instance in a docker container). I have a number of dashboards I look at every morning to keep an eye on things. E.g. Failed/successful logins, traffic sources, URI requests, file access, etc. If your server is attached to the internet it will be under attack constantly. Fail2Ban on my wireguard container banned 112 IP addresses over the last 24 hours, for 3 failed attempts to login via SSH. Less commonly, attackers try to log in to my Nextcloud instance. And my WordPress site is under constant attack. If you choose to run Wordpress, be very careful about the plugins you choose to install, and then keep them up to date. Wordpress itself is reasonably secure, the plugins are a shit-show and worse when they aren’t kept up to date.

  • @revanite@lemm.ee
    link
    fedilink
    English
    32 months ago

    I don’t know how to code, but I did a lot of internet searching on the commands to use (since I was also new to Linux). When I started to self host I was lucky the projects I wanted were popular enough that they had good documentation. Eventually after spinning up a lot of services I got the hang of the general structure of docker compose files and that’s the extent of any kind of new language I learned, haha

  • @k4j8@lemmy.world
    link
    fedilink
    English
    82 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.

    • @schizo@forum.uncomfortable.business
      link
      fedilink
      English
      42 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.

  • @habitualTartare@lemmy.world
    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.

    • @mspencer712@programming.dev
      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.

  • @reinar@distress.digital
    link
    fedilink
    English
    12 months ago

    Programming knowledge is largely irrelevant, as in to gain sensible benefits from it you have to be generalist software engineer with decade+ of experience of seeing it all. Then yeah, you can read any code, any stack traces and figure out the intent of developers of the system and what is undocumented/incorrectly documented.

    Focusing on one particular language is the right and wrong answer at the same time. Wrong in a sense that you’ll have to pick up other languages along your journey anyway and right because you need to achieve mastery in one of them to get to more advanced programming topics. Pick a language that you have fun using and don’t care about anything else.

    As for what to learn for self-hosting… Linux (pick a distro, let’s say ubuntu LTS w/o gui, ssh there and get comfortable with it. It includes installation, filesystems, RAID setups), networking, HTTP/S (that’s the main thing you’ll be interacting with as self-hoster and knowing various nuances of reverse proxying is a must), firewalling, basics of security and hardening, docker, monitoring, backups.

  • @ramenshaman@lemmy.world
    link
    fedilink
    English
    22 months ago

    Hey OP, I’m just starting my self-hosting journey as well. I can program a little bit in Python and C++ but I haven’t needed any of that so far. As others have said, some familiarity with Linux would be very helpful. The things I’ve done so far:

    • Wireguard VPN server on my router(no programming or linux commands, just some config of my router which I was able to do in the router’s GUI.
    • Wireguard VPN client on some of my devices. My phone setup was easy, still working on setting that up on my Windows/Ubuntu laptop.
    • Home Assistant on a Raspberry Pi (WIP).

    Eventually I plan to set up a NAS with Immich and some local IP cameras and Plex or something similar.