Live data from Hacker News

Ask HN: How can a total beginner start with self-hosting?

news.ycombinator.com

171–180 of 194 posts

Re: Ask HN: How can a total beginner start with self-hosting?

#171
I started self hosting recently. I bought a cheap desktop server and installed Ubuntu server on it. Every service I run is docker-compose because it’s easier than wrangling deps and such for multiple services. I use Caddy to proxy traffic and generate ssl certs.

I expose https and ssh through my router but use a non standard ssh port (keeps scripts and bots from knocking) and no root access over ssh and no password auth.

Everything runs very nicely and is simple to maintain and setup.

Data is backed up via Borg and rclone to B2.

So far so good as they say.

Re: Ask HN: How can a total beginner start with self-hosting?

#173

My thought on networking is to make sure you only expose SSH and HTTPS; firewall everything else off. SSH seems like a constant source of problems for people new to running servers; within seconds of your server coming online, people will be trying to guess usernames and passwords. Configure it so you can't log in as root, and you can only authenticate with a key. These folks will never guess your key in a billion ye…

Another tip: change the port of your ssh server. This makes connecting a small bit more tedious(create a .ssh/config file on your clients!) But in exchange you gain much less people trying to hack your machine. This should not be your only security measure though, since its still findable for some people willing to put in the effort (or targeted attacks).

Re: Ask HN: How can a total beginner start with self-hosting?

#174

I'd recommend you to check out the specialized self hosting distros and systems such as FreedomBox , Sandstorm.io, yunohost or Cloudron . I have not used it myself, so i cant recommend which system to use. However i have gone trough the pain of setting up loads of self-hosted apps. Especially if you really want to use your system, not maintain it all the time you will search for the most easy solution. There is nothi…

Yunohost : +1

Re: Ask HN: How can a total beginner start with self-hosting?

#175

Start by reading about docker and docker compose. You will have almost everything in docker containers. Pay attention to the basic networking part. Especially where it says that you can refer to a container by name in your configurations Then have a look at Caddy, a web server, to use it as a reverse proxy. You will end up with very simple configurations Read about reverse proxy in caddy's excellent doc. Test on a ma…

> Start by reading about docker and docker compose. You will have almost everything in docker containers. The case for Docker if you don't care about containerization or any of that per se is: 1) It's basically a very-up-to-date cross-distro package & service manager for Linux servers. You can ignore a ton of stuff about your underlying distro if you use Docker, and can use a very stable LTS Ubuntu or stable Debian o…

Thanks for the update, it is very relevant to my comment.

I would add one more thing: despite being discouraged, you can use an image (say, vaultwarden/server) with the tag :latest (vaultwarden/server:latest) and automatically update images to the latest version (with for instance watchtower, which is also a docker image).

This may break things. From my personal experience (5+ years of self-hosting with docker), I had a problem twice. Once was with Home Assistant and the issue was documented on their site. 5 minutes later I was good to go. The other time was with Nextcloud which failed miserably, I had to revert back to the previous container AND use a backup.

So backup! :)

If the image allows it (it is usually documented with the image), you can limit the upgrades to major/monor/patch versions. Say your product is today at 3.2.5. If you use image:3, it will be updated up to the major version (3). You will not get version 4. You can also use lower versions (:3.2 in this example) and just get the patches.

It is a decision between security, new features and availability. My personal opinion, of someone who works 30 years in IT and information security is that newer is better - you won't be alone if things break (because a lot of people use :latest and do not read teh changelogs when upgrading)

Docker is a life saver for self-hosting.

Re: Ask HN: How can a total beginner start with self-hosting?

#176
hello,

imho. self-hosting != networking

but basic networking-knowhow is necessary for self-hosting and knowing networking helps in a lot of situation :)

idk what the "best" way to learn these things in the 21st century would be today, several decades ago "the linux documentation projects" (networking) howto was a really good start.

ad hardware: use any (cheap) machine you can get or already have ... idk, an old pc, a raspberry pi or some small virtual machine at a cheap provider.

it doesn't matter and if your hardware is "to small" at a certain point in time, you will learn a lot by moving your setup from one system to another -> sooner or later you will get into configuration-management a la ansible :)

at first you need (open)SSH to be able to remotely connect to your machine.

then get a domain and start with "the" fundamental service for all internet-connected services: DNS

the most common software for this is the ISC bind.

then add something "easy" like a webserver with static pages, add TLS ... and later PHP support etc. - necessary for a lot of webapplications.

idk, use apache2 or nginx, at this stage it doesn't really matter.

the very last service to setup will be e-mail - SMTP/IMAP/POP3 & contentscanners -, which is far more complex than it seems at first sight.

as the operating system i would recommend debian, it may not be the "slickest" linux-distribution, but it contains a lot ready-to-use of packages in its repositories and has good documentation and - last but not least - a social contract.

additionally debian is the basis of a lot of well-known linux-distros, which are often heavily tailored to a certain use-case - like ubuntu/linuxmint etc.

cheersv

Re: Ask HN: How can a total beginner start with self-hosting?

#177

Earlier quoted context omitted.

> - git: Gitea "Why gitea and not bare repos?" - Better repo, user, and access management, all from a browser. - LFS support. - Being able to browse code in... well, a browser, is really nice. - GH-like workflows generally, if you want that. You can have it use sqlite for the DB to make it extremely easy to manage and backup and such. I'd expect that to be fine up to at least 50 moderately-active users, and maybe muc…

Fair enough. But I just want a place to put dotfiles that I can share between machines. If I had more complex needs than that, I would probably not have had to ask this question!

Either a dedicated dotfile or just use Syncthing.

Re: Ask HN: How can a total beginner start with self-hosting?

#179

I think you not start at home. That "last mile" of connectivity is fraught with challenges of dealing with your internet provider and all sorts of other things. It can be a headache, and it's very particular to your situation, and your provider. If you start "self hosting" on a cloud based instance, all that you learn in doing so will carry over to when you finally are able to move everything to a machine in house. I…

> If you start "self hosting" on a cloud based instance ...

I can't anti-suggest this more. Everything I've done on anything labeled "cloud" is weird and special, in ways that would impede learning or dilute its quality. They're several wrapper layers above what's really going on.

Get a bare VPS (I'd start with one listed at LowEndBox for a couple bucks a month) or dedicated host for learning. After you've learned there, you can try learning the significant extra complexity of "cloud".

Re: Ask HN: How can a total beginner start with self-hosting?

#180
I have a Synology DS720+ and I use it to store all my photos. Two things have happened incidentally: - I became an expert in networking. Opening ports, configuring VPNs, DNSs... all of this has required some time but ultimately I am happy. - I became aware of security. Synology defaults are good enough even though you really fear the idea of being attacked, so I had to dig up how to secure my synology even more.

In the end, DS720+ together with Snyology Photos (Gphotos replacement), Drive (Dropbox replacement) and two drives of 6TB in RAID, costed me around 700€.

Post reply on HN