zilexa / Homeserver

Lightweight home server based on microservices, usable as desktop workstation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The Modern HomeServer

A complete Guide, making it just as simple and easy to setup and maintain your own, fully flexible, simple selfhosted homeserver as more limited, power-hungry but ready-to-go solutions such as Synology, Xpenelogy, Unraid or TrueNAS.

Tip: a wider desktop view of this page.

Why A Selfhosted Homeserver? | Intro to microservices | Hardware Recommendations | How To Get Started?


A fast, very low-maintenance, maximum energy efficient selfhosted cloud.

Can be used for any selfhosted system (from home automation to password manager).

Can also be deployed and run in the background on your HomePC/Workstation.

Carefully selected hardware recommendations.

Carefully selected Operating System and server tools.

Preconfigured automatic nightly/monthly maintenance.

Carefully selected services for file cloud, password manager, media downloads and more.

Note: I had zero experience when I started and learned everything by googling, spending time on fora, reddit and in documentations and by hours and days of trial&error. I made lots of mistakes. Now, in case of disaster I will use the scripts in this repository myself to get up and running again. I am documenting this because I haven't found a single source online that provides all necessary information to get up and running. Also, lot's of things have been carefully chosen after testing alternatives. You can save lots of time with this guide! :) basic Linux commands.

Features

  • A file cloud using: FileRun - Access and share your files from everywhere, sync your devices and enjoy your photo albums from any device, anywhere in the world. Fast and secure!
  • A fantastic password manager: VaultWarden - a.k.a Bitwarden, the best password manager available.
  • Your own Office Online/Google Docs: OnlyOffice - integrates nicely with FileRun.
  • Your own browser sync: Firefox Sync Server - your history, passwords, form fill info etc no longer shared with 3rd parties and easy to sync from laptop to phone.
  • A highly secured reverse web proxy to be able to use all these features via your own domain like https://my.domain.cloud.
  • Your own ad-filtering or parental filtering dns server: AdGuard Home - no more ads on any device within your network and even on your phone when you leave the house.
  • Your own very fast VPN: Wireguard - Your own VPN server and easy management of clients. To access services you do not want to expose publicly online.
  • Your own paper scanning and organizing system Paperless-ng - helps you to automatically archive your household administration and access documents easily.
  • Your own media center server JellyFin - Watch your series and movies on any smart TV or device. Also when you leave the home via VPN.
  • Automatically follow and retrieve your favourite tv shows and movies Sonarr Radarr Bazarr QBittorrent Because nobody can pay for every streaming service just to watch the few shows or movies they like.
  • Pretty dashboards to monitor your server Grafana, Prometheus - Not necessary, but handy and with notifications.
  • Your own homepage to quickly access each service in a single webpage Plugsy See preview here.

For more details per service, see here.


Requirements

Regardless of your hardware (x86-64 or ARM, see Hardware Recommendations, for the scripts in this guide to work, the following is required, otherwise you may need to change the install commands, build software, figure out how to configure email notifications etc:

  • Arch based OS
  • AUR (Arch User Repository)
  • Pamac to be able to install AUR packages
  • Pacman to be able to install packages
  • BTRFS filesystem - with or without swapfile (no swap partition)

Manjaro on x86-64 (Intel/AMD) is the recommended OS of choice and used for this guide. It does not matter which desktop flavor you choose. I use Gnome but power users might want to consider KDE instead.

This guide used to be Ubuntu-based. All my laptops/PCs and my parents systems ran Ubuntu Budgie. After 2 years I switched to Manjaro (Gnome edition) and it is a delight! A much better out-of-the-box experience, more user-friendly (also for setting up a server! This is reflected in my scripts, they are a lot smaller) lightweight, small footprint, much better and up to date single source of high quality documentation (Arch Wiki) and MUCH easier to install applications + keep up to date than any Ubuntu system. Also, better out-of-the-box BTRFS support. For small, flexible homeservers and personal laptops I strongly believe BTRFS is the best filesystem. If you have more needs, look at XFS/ZFS. This guide will use BTRFS.

Step 0: get the right hardware, most motherboards and CPUs are not designed for 24/7/365 continuous running, instead, they are designed for performance.


Step 1 - Install Operating System & Essential Tools

Step 1A - How to install Manjaro?

How to prep a USB stick: see Manjaro First Steps > Using a Live System. Further Instructions here.

Note

  • Requirement: select BTRFS during setup with no swap, this allows you to later enable swapfile with hibernate support or zRAM.
  • Requirement: Do not select "automatically login..", if you do, you will be faced with key-ring issues when using docker. Solveable but not covered by this guide.
  • Consider using my Manjaro Gnome Post-Install script. It is meant for both clients of your servers (laptops, PCs for you or your family) but also gives you a little headstart in this guide. You can always easily remove applications you do not need later, as the "App Store" of Manjaro is one of the best and fastest available in Linux world.

Step 1B. How to properly install Docker and essential tools?

Turn your system into a modern server with 1 click with prep_server.sh to automatically or manually install essential tools, apply basic configuration + required stuff for optional docker services.

It is recommended to read through the prep_server.sh to get an idea what it does and why. It has been carefully created to install the tools required to run all aspects of your server (from docker to mainentance tasks).
Official documentation is used to install tools correctly and all tools will be installed using the offical Manjaro package manager, a single package manager that keeps applications, OS and drivers up to date.

Download and install it via:

cd Downloads && wget https://raw.githubusercontent.com/zilexa/Homeserver/master/prep-server.sh
bash prep-server.sh

Note

  • A subvolume for Docker will be created --> allows extremely easy daily or hourly backups and recovery.
  • Installs Docker and follows official best practices to manage docker as non-root user (not rootless).
  • Allows OS support to send emails (with minimal set of tools and configuration), several Docker containers and your maintenance tasks will need this.
  • Installs several other essential tools, essential for example for data migration, backups, maintenance.
  • Optional config files for a few services (will ask y/n before downloading).For example if you are going to use torrents, consider using the QBittorrent config file. The Organizr config might be nice and will save you lots of time building your own "Start" page.

Step 2 - Filesystems and Folderstructure

This is the most time-consuming and complex part of creating your homeserver as there are many choices to be made, not just for your filesystem but also folderstructure.

  1. Check the Filesystem Options. Decide what is best for you.
  2. Follow the Filesystems Guide

Step 3. Data Migration

Data Migration - Move files to your server data pool.


Step 4 - Network configuration

Before you can access your services outside of your home, prepare your network and get your own domain.


Step 5 - Docker Compose Guide - customisation and personalisation

Docker Compose Guide There are a lot of guides and docker-compose.yml files. Most of them are not complete or do not adhere to Docker best practices. A lot of hours have been spent on the yml file in this repository to ensure it follows best practices, does not contain unneccessary complexities and is as generic as possible, so that it can be published without security concerns. The .env file allows you to personalize your compose file through variables.

Note:

  • The carefully written docker-compose.yml file is the unique part of this guide!. It can be tailored to your needs with Minimal Effort.
  • You cannot finalise your docker-compose without having a single path to your data and your media, covered in step 2.
  • The services you want to access via your own domain won't work until you have completed step 3.

Step 6 - Configure your apps & services

The Docker guide (step 3) explains how to access your services. Configuring & using your services is not covered by this guide. The overview of Docker applications below will contain some foldable sections with hints. Configure Apps & Services contains direct links to the documentation or homepage of each Docker app.


Step 7 - Configure & run Backups

Critical to enjoy the benefits of hosting your own server is the reliability of data storage and the ability to quickly recover a system (simply using your docker folder containing the folders you mount into containers). Follow the Backup Guide.


Step 8 - Automatic Maintenance and optional manual maintenance

To keep your server purring quietly, without having to spend much or any time keeping it running, follow the Maintenance Guide for regular cleanup, updates of server and docker images and filesystem/drive maintenance.

About

Lightweight home server based on microservices, usable as desktop workstation


Languages

Language:Shell 98.4%Language:PHP 1.6%