Setting up a home server

I tried searching in articles on itsfoss, but this is new territory for me, so needing to know of any tutorials/resources available to even see if this is something I can accomplish.

I am trying to install a program (via their website instructions) where if you do not want to use the cloud-versions (I do not) you “host it on your own server.”

Since this is a FOSS accounting program, I assume the purpose of installing on a server is so that: a) accessible from anywhere? b) data is more secure when residing on a server vs. your own desktop? and c) data is still backed up to a cloud somewhere (i.e., Nextcloud, etc.) and thus secure?

Reading a lot of discussion on here, I have been thinking about setting up a home file server, but need to know if/how that differs from hosting your own instance of a program.

Maybe some initial key concepts to enhance my understanding of not only how this works, but also what hardware/software would be required to have one running in my home office.

I am starting another business and already finding it difficult to operate on someone else’s network when I am working at their location, on their wifi. Just wondering if I could access my home office programs & files from my work laptop when I am away from home by setting up a server.

My second reason I alluded to in the beginning: I hate working in a browser or using cloud accounting. I want the desktop app and for me to control access to my data.

Any help much appreciated.

Sheila Flanagan

You need to be aware that if you make a machine a server which is accessible from anywhere via internet, you need to take much more elaborate security provisions than you would on a simple home computer.
I think, today, most servers would be setup to be accessible via a VPN. I have zero experience with VPN.

2 Likes

Thanks, @nevj . I use a VPN on my home router, and can install that on the server. I just need to know how the “server” thing works. I have an old, old laptop which could be used as long as it does not need to be fast (I guess), otherwise I might purchase a newer, old computer to use. Just need to know how fast it needs to be for access remotely, etc.

Sheila

1 Like

I dont imagine it needs to be super fast. It only needs to handle files, not do calculations. It would want to be modern enough to run up to date software. It would need a firewall. If you leave it on all the time, an SSD would be good.
Probably the most important component would be the internet link…ethernet would be better than wireless.

2 Likes

Yes @nevj I could install a small SSD. As I understand it, you only need enough space for the OS and software I am hosting? Would probably need to install Lubuntu or Linux Lite, as it is very old, 4 gb RAM. I assume I can set up the firewall in the OS and it would definitely need to reside next to router in order to use ethernet cable as I expect connecting from outside the home would be too slow without ethernet.

I am reading articles on setup with Linux and I will need to learn the SSH command?

Sheila

It will need to to run the sshd daemon.
That is easy…, I think the package is called openssh or maybe opensshd. If you install the package in Debian, it will automatically start the daemon.
The easiest way to use ssh is to let it ask for a password every time you login.
If you have ssh setup, you can use scp, sftp, and rsync… they all use ssh underneath.

3 Likes

Hi Sheila, there are a lot of good articles on setting up self hosted applications on Self Hosted Archives - LinuxBabe. All the commands used are in each of the articles, so you can follow along. Take a look if you are curious.

4 Likes

Hi, @J_M thanks so much! Had not run across that one.

Sheila Flanagan

No problem, you’re welcome!

I won’t write a complete tutorial, just my own choices, and why I choosed that particular thing, and try not to forget something…
All my sentences meant to start/end with “-I think”, as I don’t have the “philosopher’s Stone” in my pocket.
So you want a home server, and self-host whatever you can: the very first thing to consider, what you really want it to use for at the moment? (Later you’ll implement new functions anyway… :slight_smile: ) Many think of a home serer as kind of NAS, which you can buy ready-made, something like a QNap. This is well designed for data storage and acces in your LAN, it runs kind of energy-efficient.
But the flexibility is zero, you will have the functions “burnt” into the firmware, if you need a new function which it doesn’t provide out of the box, the chance to integrate it into the device is zero.
If you whish to go the uncomfortable but flexible way, you will end up installing a Linux as a headless server (no keyboard, no screen attached to the computer), which you administer remotely.
The second t consider, how much do you want to spend on it?

My home serverver has couple of functions to fulfill my whishes.
One of these functions is similar to what you seem to like to achieve, namely get access to your data remotely.
Because of historical reasons I use Debian (Bullseye at moment) on my servers.
You could choose any distro you like, but I favor Debian.
Choose a low-power demanding hardware, otherwise your energy will cost more than a business account at a cloud provider :slight_smile:
My very first chioce (back around 2010 or so) was an intel-Atom based board, then changed it to a J37something Celeron(?) based board, which performed hugely better than the acient Atom, still drawing similar (somewhat less) power, endly a Fujitsu machine with an i5-45??T CPU (intel CPU with letter ending with “T” run on lower clock freq. and consume less energy).
Then I hopped architecture, and went for the Odroid HC4, which is Arm based, draws way much less power, still performs quite well - from my point of view the HC4 is just the absolute perfect device for implementing a home server.

So choose what you can afford, what you can feed with power easily.
I can warmly recommend the Odroid, probably there are other models too.

So choose a hardware, then choose a distro you will be comfortable with on cli.
As for data storage, and allowing it to be accessible remotely the most popular self hosted solution is probably Nextcloud. It has syncing clients for common platforms, and there are numoerous extensions for it. It is written in php, and requires a webserver instance to run on - at least this was the case when I last time checked it.
My choice was Seafile (community edition).
Because when I looked for the solution, Seafile server performed huuuugeely better than Nextcloud and it had the syncing clients for the platforms I used.
I think it still outperforms Nextcloud on the same hardware, but I did not test recently. Nowadays I have near 4TB data in Seafile, it survived multiple movings between OS upgrades and changes, such as upgrading Ubuntu server 10.04 to 12.04, or moving from Ubuntu server to Debian, upgrading Debian and and last year I did an architecture-hop from the intel platform to an arm based.

Regarding security I have set up fail2ban on all my servers, as I run mailserver too, I did the hardenings for that, but other than these I did not take very special security settings. So I have my home server running:

  • on Debian 11
  • on Odroid HC4
    (having 2 disks, one big 3,5" spinner that holds the “big-data” :slight_smile: and a smaller 2,5" sized low-power spinner which is basically always on. The bigger spins down if not in active use, so reducing energy consumption. During idling it takes between 5…6W on heavy usage 15…17W)

It runs now Seafile server 9.02 for the RPi (MariaDB as data backend).
(Rpi binary runs on Odroid as well)
My server runs ftp server (vsftpd), nginx as webserver (I found this way much more effective, less resource hungry, and faster than Apache), there’s a postfix
instance, dovecot+ spamassassin (+roundcube on nginx&php).
For the LAN it works as NFS and Samba server.
It also works as a DNS and DHCP server for my LAN, the DNS has filtering, like Pi-hole (this is done by dnsmasq). For WebDAV I enabled the DAV server of Seafile, that lets me use Foldersync on Android devices. CalDAV / CardDAV is not supported by Seafile, so for that I choosed Radicale.

I have an account at dynu for the DDNS, so my homeserver is always reachable using a FQDN, the IP is updated by ddclient running on my home server…

My family memebers are connected to the Seafile server instance, that means 6 active users, from 13 devices (desktops, laptops, tablets / phones).
I use my own self-hosted email, and 2 of my friends have (unlimited - without quota :slight_smile: ) email accounts on my server, basically it serves as emailer for 14 addresses on 7 domains.
I mention these facts just to see that ALL these run perfectly happy on Debian powered little gadget.

I need to emphasize, that I take backup of everything stored on the server every night, and this is automated, so I won’t forget it. I’d hate to loose data because of a HDD failing.

In case you choose something from my list, I’m ready to help you configuring it on your server.

2 Likes

@kovacslt, Wow! Thank you so much for that information. Sorry I am just getting back, but work has been nonstop this week so will have this weekend to get a plan in motion. I will be making a checklist and definitely using some of these items, except for the hardware. I am still unsure whether to just use an old laptop and add an external 5 tb drive to it or purchase something like a Pi. I just need something that doesn’t take a lot of room and yet can handle the files from multiple devices as well as allow me access to those files/apps from anywhere.

Hopefully, I can use what I have, but when you spoke about “spinning” I assume you are not using SSDs. Can I ask why? And you mention NextCloud…which I currently use a free account on, but this would be for the server backup? But Seafile is also a cloud for backing up the server?

I currently use a CalDAV/CardDav service and that would also need to be on the server. Have not heard of Radicale, but will check it out.

It all seems a bit overwhelming needing to decide which programs to use for what. I guess I thought a server was no different than a desktop, aside from needing a couple of things for security and the apps hosted on top of the server OS.

I also pay for a VPN. So I assume I do not have to worry about the DDNS stuff? Or do I? That is new territory for me as well.

I am most comfortable with the CLI in Ubuntu-based systems, and not sure I understand the difference between Debian XX, since Ubuntu is based on Debian, right?

I look forward to your reply and hope to have an outline of setup and my needs so that I can post that here for your assistance as well as others who can contribute.

Thanks so much,
Sheila Flanagan

2 Likes

This weekend is going to be chaotic on my side. I’ll try cover all your questions later :wink:
Cheers

1 Like

As 2023 draws to a close - I am still using a HP “ProLiant” ([dual AMD Turion CPU] don’t get me started on how much I hate HP - ransomware to license your iLO to boot off ISO images?) N40L I bought in December 2011… still going strong… FreeNAS 8 or something back then… 8 GB of DDR3 and 4 x 1 TB 10K RPM drives in RAID5 (software RAID didn’t trust HP’s implementation - advice - hardware RAID is nearly always shit to be avoided) I think UFS - then I upgraded all 4 drives to 1.5 TB WD green drives for a monumental increase of 500 GB storage…

By then I still had alternative storage to migrate to/from - so I switched to a Solaris x86 based solution for a few months… Then went to NAS4Free (a fork of FreeNAS) - still no good…

Ended up back in the FreeNAS camp anyway - and as the Solaris X86 solution was ZFS - it was a no-brainer.

So - now on the same hardware from late 2011 - I’m running TrueNAS 13 - with 4x4TB WD Blue drives, 16 GB of ECC… The current interation is from circa 2018 or so…
TrueNAS does everything I need… ZFS is the king of File Systems IMHO (on FreeBSD anyway - I’ve had lacklustre experiences with ZFS on Linux)…

The “beauty” of TrueNAS and ZFS is that I can slowly (over weeks) replace the 4 x 4 TB drives with bigger drives, and not till the final “re-silvering” is done - will I reap the benefits - but it will be astronomical, e.g. slowly replace each 4 TB “member” with 8 or 16 TB drives…

2 Likes

It’s been so long since I purchased any HDD drives that I did not even know they had those speeds now. I think my last ones were 5k RPMs.

My current external WD 5 TB drives USB 3.0. Do external HDDs not have RPM specs? I couldn’t find it. But I am assuming I need internal HDDs? Just my assumption that anything “inside” connected to mobo has to be faster than USB-connected devices.

But never having used an “old” laptop for server before, will a newer, faster HDD will even work in that old of a machine (like 2006 Toshiba that came with Windows XP on it)?

Thanks,
Sheila

1 Like

First of all, you are welcome :smiley:

I think, as en exercise -or prototype- the old laptop is OK. You can implement your server on it, experiment, do the necessary configs,and test-drive it.

But for the long run, I think, I’d invest in a more energy-efficient device.
(And old laptop could draw massive 30W, which is almost 22kWh a month, if you run it 24/7)

Exactly, I use regular HDD’s. Not because I don’t like SSD’s or such… :slight_smile:
Simply because I need storage capacity more than performance. I use SSD everywhere I need performace…
With those spinning drives I get the performance I expect, but at approx 30% of the price that would take to have SSD’s.
A 4TB HDD I can get for approx 38€, whereas a SSD with the same capacity would cost 250€.

Because my network limits transfer speed to ~100MB/s anyway, I would not get much more performance.

I meant both Seafile and Nextcloud self-hosted on your server. I have deployed Seafile on my server, because it was way much more performant than Nextcloud, at the time I choosed. I don’t know, if it’s still the case, but I suspect it is.

In reality “cloud” is something that makes rain fall. In IT for people the experts talk about cloud, it means a bunch of server of which they don’t kow anything.
I don’t trust the so called “cloud” at all, mainly for privacy related things, but also because I want to be the guilty myself, if I loose my data. Let me mention: RAID is not a backup - #22 by kovacslt

For backup, I have a dedicated computer, which switches on nightly, rsnycs data blobs from my server and shuts down. (It’s more complicated than that, but basically it works this way)

There are numerous options. Nextcloud offers it too (AFAIK), and there’s Baikal
https://sabre.io/baikal/
Davical
https://www.davical.org/

but because of simplicity, and performance I choosed Radicale.

Oh they differ in the way being used.
You (human) interact with your desktop directly, using keyboard / mouse and watch the display of it…
Normally you don’t have such a direct interaction with your server, so it doesn’t have to have keyboard and display. Well, at the initial configuration, and later if something goes wrong, and you can’t reach it via SSH, then yes, a keyboard and a monitor comes handy :slight_smile:
But this is not the normal operation.

So on the server you don’t need a heap of stuff you need on a desktop.
But you will need the server processes, which will be basically the main goal.

So when you are far away from your home network, how do you find it?
Do you plan to use your own services (CalDAV for example) to use with a mobile device too? Android maybe? Do you connect to your VPN with your mobile every time you want to snychronize your calendar entries?

Ubuntu is based Debian testing, so they don’t differ on CLI level.
Debian is just my choice -because of a few reasons-, but you can base your instace on Ubuntu of course.

Sure. External drives are just 2,5" internal drive assembled in an USB case.
Run sudo smartctl -i /dev/sdX where sdX is your USB attached drive. You’ll get the all the details of the HDD placed into that case, knowing the model, you can look up the specs on the manufacturers site.

The drive itself shouldn’t be a problem, but the question is: the USB case is probably meant for USB3, will it work with USB2? If the thing doesn’t need excess power to start, it will work, of course only with USB2 performance. If it doesn’t even start (the HDD in the case does not spin up), it will not work.

2 Likes

Hi László,
I’m building a server with an old PC. Out of curiosity, are you talking about RaspPi or another solution?

Jorge

I forgot to mention - I host my own cloud solution on my NAS (TrueNAS / FreeNAS) - Resilio Sync - it’s bullet proof and FAST.

I’m lucky in a certain respect, I first used Reslio Sync on my BYOD NAS solution when it was still called FreeNAS and version 11, and it had an easily installable plugin / jail for this (Resilio Sync) on the list of installable plugins - that plugin is no longer easily available on (now) TrueNAS 13.x or later (I’ve seen people make it work). But it continues to work for me… works everywhere, on everything - prior to that I was using Dropbox (but they don’t have agents / clients for ARM Linux e.g. Raspberry Pi) - from single core Debian Jessie NTC CHIP, to RPi Zero and Zero 2W, and OrangePi (uptime 384 days!) and - Windows, and every x86 / x86_64 Linux you can think of - and - MacOS ARM64 and Intel - and freely available binaries for FreeBSD on x86_64).

If I planned things properly - I could replace the NAS solution completely with Resilio Sync, but I don’t need my whole 2+ TB collection of movies from the last 20 years…

And most cloud storage solutions require one to have that much storage on the local machine anyway (e.g. my 2 TB movies collection, has 2 TB on the master, and requires 2 TB on the client - I could to selective sync, but that’s too much housekeeping)…

So I’ll stick with my current solution…

TrueNAS pretty straightforward SMB (Windows sharing) and NFS (bulletproof) out of the box - if I see a NAS solution that doesn’t make NFS easy (or at least a no brainer) I will eschew it and keep searching… TrueNAS runs ontop of UNIX (FreeBSD) and I get my shell, with ZSH, and oh-my-zsh, and most of my Linux shell scripts work equally well there…

3 Likes

I’m talking about SBC’s, mainly ARM based. (Well, especially about the Odroid, but let me mention other possibilities before it)
So, the RaspPi can be one such solution, but there’s BananaPi, maybe something from Pine64, or Asus(?) tinkerboard comes to my mind.
Intel NUC with low powered J#### CPU could be a candidate too.
But my favourite is definitely the Odroid, namely the model HC4.

I suggest to buy a power meter, which you plug into the mains socket, and it measures how much power your device draws from the powergrid.

I have a very-very similar one to this:

Actually the same, just with european plug/socket.

Having such a meter you can measure the actual power requirement of a device.
If it’s a computer (server?) wait until it fully boots and settles.
Then you will see the power usage during idling.
A home server probably 95% of it’s time will be just idling, and waiting for request to serve. So you can estimate the yearly cost of your device having up and running.
Read the W, and multiply:
E(yearly)=(P(idle) * 95 + P(loaded) * 5 ) * 24 * 3.65 [Wh]
Edit: (Divide the result by 1000 to have a kWh unit)
This is just an estimation, assuming the server will idle for 95% and loaded for 5%. I see on my server, that in 4 days and 5 hours approx 5 hours CPU time is used up, so I statistically consider the idling time was 95%.
Having the value of E(yearly) and knowing the price of electricity where you live, you can make a very good guess what device is worth to buy (if any) and if you buy a more frugal device, in what time it pays back.

So please @Tech_JA, @Sheila_Flanagan, measure, calculate, estimate, and decide what to buy (if anything at all :slight_smile: ).

I’m so much satisfied with my Odroid HC4, that I cannot make an unbiased recommendation, I simply cannot suggest any other device for a home server :slight_smile: Please forgive me my highly biased opinion. :pleading_face:

I’m thinking of making a video demo, how my home server performs in my ecosystem, if you are interested.

Of course there’s a negligible chance that the server building project fails, and results in nothing usable. That’s why I suggest to build/config/test-drive a server with a hardware that you already have. So you won’t waste money on a device, which you later can’t use. If you can build up your server on a something-hardware, you’ll be able to repeat it on an Odroid* ( :star_struck: ) as well.

*: …or Intel NUC, or RaspPi, or BananPi, or…

1 Like

Hi László,
Thanks for your reply.
I asked if it was the RaspPi because it’s been out of stock, but you mentioned the Odroid HC4, which I didn’t know about.

Thanks for the explanation and the formula to calculate the yearly cost (approximately) to have the server connected 24/7.

I’ll look into Odroid and I’ll also check the consumption of my old PC.

I’ve been running tests with docker on that old PC and I turn it off when I’m done testing, but as soon as I have more time, I want to get it working, or an ARM 24/7.

Thanks for your help

Jorge

2 Likes

This brings up a good point. Can you explain the difference between the ARM vs AMD vs Intel (I am familiar with the last two as I have always owned Intel but just bought an AMD 2-in-1 from Lenovo)? From years back, I always stayed away from ARM processors, but that was on Windows. Can you give me the pros and cons of each?

I am still working on the other items, but I think you are right, I don’t need to use the old laptop but purchase an energy efficient model with room for stackable drives.

I did research a lot this weekend on Resilio Sync and I am leaning towards that for the cloud solution. But @daniel.m.tripp mentioned the FreeNAS solution so am also looking at how that ties into Resilio. But you mentioned Seafile, so still have to look at that.

I definitely need to connect remotely so maybe the DDNS stuff matters, if as I understand, you do not let the VPN manage the DNS? You need static for connecting remotely?

As for CalDAV, I read on the DavX5 and that sounds good, just not sure if it is easier to keep the Etesync setup I have now (since I have 6-7 calendars plus tasks & contacts) and host it myself as it is not that expensive.

So there is an Ubuntu Server edition? I have not spent time on the OS as the other items are so foreign that I felt the need to delve into them first.

Thanks for all your help. I will be back with a list of possible hardware setups for opinions before purchasing.

Sheila