2021-03-03-new-home-server.html (6706B) - raw


      1 <!-- title: New home server -->
      2 <!-- slug: new-home-server -->
      3 <!-- categories: Decentralization, Self-hosting -->
      4 <!-- date: 2021-03-03T18:39:00Z -->
      5 
      6 <p>
      7   During this past year, I have been coming up with a variety of services that I want to host from
      8   home. The problem was that I didn't have a computer to host them on, so I decided to buy one
      9   before my Christmas vacation, when I would have time to tinker with it. Because of the gifting
     10   tradition, I was asked if there was anything that I wanted, so I ended up getting it for Christmas
     11   instead. In case you are curious, the computer is a Raspberry Pi 4 Model B, I decided to go with a
     12   Raspberry Pi because it's the only device I have experience with and it has worked great, on top
     13   of having good specs at a good price. I already have a server running round-the-clock (the one
     14   hosting this website), so why did I need another machine running nonstop? For two reasons: control
     15   and proximity.</p>
     16 <!-- /p -->
     17 
     18 <p>
     19   When I talk about "my server", I mean a virtual private server (VPS) that I rent. "My server" can
     20   be more accurately described as a virtual machine that lives in someone else's computer and that I
     21   can administer for a certain fee. This is great for many reasons which can be summarized in "I
     22   don't have to deal with any infrastructure-related matter": the server's owner takes care of
     23   maintenance, broken parts, refrigeration, etc. On top of that, the server has a very fast internet
     24   connection and a static IP. So it's a machine that has all the needed features to start serving
     25   content to the internet. However, because this is someone else's computer, they have complete
     26   access to it. My guess is nobody is accessing my data—it probably takes some effort to automate
     27   scraping virtual machines, and I think I'm not interesting enough to be a target—, but that is not
     28   a reassuring argument, so I don't trust my VPS with my private data. With a computer at home, I
     29   have full control of everything that is happening, and I am more comfortable saving personal data
     30   there.</p>
     31 <!-- /p -->
     32 
     33 <p>
     34   That was related to control, let's look at proximity. The VPS is hosted somewhere far away (I
     35   believe in Germany), so the only feasible way to connect to it is through an internet connection.
     36   This comes with limitations—you need internet, and internet connections are slower than local
     37   ones. Moreover, I want to be able to unplug external hard drives and plug them into my computer to
     38   have instant access to any data (for example to make a copy to give to someone), as well as the
     39   other way around: I want to be able to grab a USB drive, connect it to my local server and have
     40   all the data available from all the devices in the network. For obvious reasons, I can't do that
     41   with my VPS. Finally, because my home server is not exposing any service to the internet, it is
     42   much harder to hack it or for some data to get leaked.</p>
     43 <!-- /p -->
     44 
     45 <p>
     46   More arguments come to mind of why some things are better hosted at home, but I think by now the
     47   general feeling has gotten across, so let's jump into what I've done so far and what are some
     48   ideas I have for the future.</p>
     49 <!-- /p -->
     50 
     51 <p>What I currently have:</p>
     52 
     53 <ul>
     54   <li>
     55     <strong>Media center</strong>: Well, something like it... I originally thought about
     56     self-hosting Jellyfin or Plex, but the first time I wanted to use the media center I didn't have
     57     much time to set it up, so I made a <em>very</em> minimal Apache site with an HTML file linking
     58     to multiple videos and podcasts I had downloaded. Surprisingly, this setup has been working
     59     great so far. I have created a script that autogenerates the page from a JSON with all the
     60     metadata of the files I have and I have added some features (like marking media as "seen"). Now,
     61     all I need to access the files is a web browser and, in some cases, <a href="https://mpv.io">mpv</a>
     62     or <a href="https://www.videolan.org">VLC</a> if the format is not supported on the browser (did
     63     you know you can stream videos with them?)</li>
     64   <!-- /li -->
     65   <li>
     66     <strong>Git backup</strong>: It backs up all my Git repositories from different providers. It
     67     does so with a <a href="https://git.oscarbenedito.com/git-backup/">Python script</a> I made some
     68     time ago that given some authentication tokens, will mirror all my repositories (and any others
     69     that I tell it to).</li>
     70   <!-- /li -->
     71   <li>
     72     <strong>Syncthing</strong>: It runs Syncthing as another peer for all my folders. This way, all
     73     my devices are always synchronized with the Raspberry Pi. Previously, two of them had to be on
     74     and connected to have any synchronization. This also acts as a quick transparent backup for my
     75     data, since the RPi is backed up daily.</li>
     76   <!-- /li -->
     77 </ul>
     78 
     79 <p>My plans for the future are the following:</p>
     80 
     81 <ul>
     82   <li>
     83     <strong>Expanding the media center</strong>: Add more functionality to the scripts generating
     84     the webpage, add functionality to the website to be able to do some basic operations without the
     85     need to SSH into the Raspberry Pi, and add more types of content.</li>
     86   <!-- /li -->
     87   <li>
     88     <strong>Backup center</strong>: I'm not sure if "backup center" means anything (or if I'm using
     89     it correctly), but as my backup center, the Raspberry Pi would be in charge of backing up all my
     90     devices. Syncthing already helps with my phone and some other small folders, but I'd like to
     91     improve my backup system so that a lot more data can be automatically backed up. I think with my
     92     home server it will be much easier to regularly pull data from the services I use as well as
     93     have a centralized location to which send my files.</li>
     94   <!-- /li -->
     95   <li>
     96     <strong>Calendar and contacts synchronization</strong>: Right now, I use my email provider to
     97     synchronize my contacts, calendar and reminders using the CardDAV and CalDAV protocols. I would
     98     like to stop sending that information online and just have it synchronize with my home server
     99     (ideally with the same protocols).</li>
    100   <!-- /li -->
    101   <li>
    102     <strong>Photo and video library</strong>: I want to centralize all the photos and videos I have
    103     (and the rest of the family's as well) and have a good interface to access them. This will
    104     include sorting them out and will probably take a lot of time, so I'm not sure if I'll end up
    105     doing it.</li>
    106   <!-- /li -->
    107 </ul>
    108 
    109 <p>
    110   ... and anything else that comes to mind! I enjoy playing around with new software and I have been
    111   enjoying every step of the move towards a more self-hosting setup, so I am sure that more things
    112   will come up!</p>
    113 <!-- /p -->