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!
- 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.
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.
Patience, most of all.
Also, backups and notes. The solution you use to host might take care of the backups. For example, I use Unraid, so if any drive fails the system can simulate the data on that drive until I can get it shut down to replace it, and then recreate the data on the new drive.
As for notes, those are important so that you can always know what you’ve done, and what you need to do. That way, if you ever have to do it again, say if you’re setting up another server or replacing one that failed, you know the steps you took to get it set up exactly how you like. It’s also handy because you’ll be doing things like assigning services to ports, and you’ll probably at some point want to know what services are on what ports without going through and checking each one. Things like that are handy things to stick in notes.
Other than that, you don’t need a lot of skills to set something like a home server up. You just need to read the documentation for each service you’re planning to use, and get familiar with how it works.
Unraid is not a backup. It is good, but if your data goes wrong for different reasons or you lose the entire device, you can’t restore it. Dedicated backups are a must for anything serious!
Lots of people have been talking about products and tools. It’s docker, tailscale, cloudflare proxmox etc. These are important, but will likely come and go on a long enough timescale.
In terms of actual skills, there’s two that will dramatically decrease your headaches. Documention and backup planning. The problem with developing those skills is, to my knowledge, they’ve only ever been obtained through suffering. Trying to remember how to rebuild something when you built it 6 months ago is futile. Trying to recover borked data is brutal. There’s no fail-safe that you haven’t created, and there’s no history that you haven’t written. Fortunately, these are also the most transferable skills.
My advice is, jump in. Don’t hesitate. The chops in docker/linux/networking will come with use and familiarity. If it looks cool, do it. Make mistakes. You will rapidly realise what the problems with your set up are. You will gain knowledge in leaps and bounds from breaking a thing vs learning by rote or lesson. Reframe the headaches as a feature, not a bug - they’re highlighting holes in your understanding. They signpost the way to being a better tech, and a more stable production environment.
The greatest bit about self hosting for me is planning the next great leap forward, making it better, cleaner, more robust. Growing the confidence in your abilities to create a system you can trust. Honing your skills and toolset is the entirety of the excercise, so jump in, and don’t focus on any one thing to master or practice before hand!
Networking is way more important than pretty much anything else. TCP/IP and http are going to stay for quite a while.
The ability to read, and maybe watch a video. And then persistence for some of the trial and error you will run in to. All skills you need can be picked up with the above.
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.
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.
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.
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 freakin’ 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 tailscale 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) over 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.
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.
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.
If you have a VM, there is no need for docker. Start by installing ssh. Enable public key auth. Disable password authentication. Set up fail2ban with ssh. Set up ufw. Set up nextcloud. Avoid hosting your own mail, that’s another level of complexity. If you really need it, try mailcow.
If you have all that and didn’t touch a GUI on your way, you’re good to go.
I would not run anything outside of docker honestly. Docker is so much easier to setup and maintain.
Absolutely can and should use docker in a VM. ☺️
Documentation has been mentioned already, what I’d add to that is planning.
Start with a list of high-level objectives, as in “Need a way to save notes, ideas, documents, between multiple systems, including mobile devices”.
Then break that down to high-level requirements such as “Implement Joplin, and a sync solution”.
Those high-level requirements then spawn system requirements, such as Joplin needs X disk space, user accounts, etc.
Each of those branches out to technical requirements, which are single-line, single-task descriptions (you can skip this, it’s a nice-to-have):
“Create folder Joplin on server A”
“Set folder permissions XYZ on Joplin folder”
Think of it all as a tree, starting from your objectives. If you document it like this first, you won’t go doing something as you build that you won’t remember why you’re doing it, or make decisions on the fly that conflict with other objectives.
This is really smart actually
I would caution against self hosting email long term. It’s fine for the educational value but there’s a lot of annoying obstacles you can encounter repeatedly even after everything is established.
the patience to read lots of documentation.
And maybe patience to power through a lack of documentation.
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.
I think if you have a mini PC or something you don’t mins installing server specific OS on, proxmox VE is pretty great. It can be a bit of a headache depending on what you want to do but it also makes expanding your self hosting super easy/fun.
Proxmox let’s you created virtual machines or containers and easily manage them.
Currently I run a mini PC.(Beelinks are great for this and pretty cheap with more power than a raspberry pi)
- Proxmox VE as the operating system
- Jellyfin as my media server
- looking to install home assistant and some others as well.
- Tail scale to use as a VPN into my network privately from anywhere.
Simplest set up? No. But I also just started self hosting. You’re gonna hit some.headaches regardless but it’s also extremely rewarding and I’ve learned alot.
Edit: if you’re only wanting to run one thing (say jellyfin) . A raspberry pi with tail scale and jellyfin is how I started. Works just fine.
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) andchown
(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.No special knowledge needed except the very basic ability to understand and run commands from documentation.
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
Networking isn’t specific to Linux. It’s just networking. Nginx configs work the same on every OS.
Who said anything about linux
Until you run into some kind of problem :D
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.
Why didn’t you do a rollback?
I self host many services without any coding languages under my belt. I use Unraid because u found it user friendly for a newb like me. The most important skills I needed were good data backup habits just in case I messed something up, a willingness to read and learn, and the persistence to try more than once.