/Homeserver

Lightweight home server based on microservices, usable as desktop workstation

Primary LanguageShell

The Modern HomeServer

Tip: a wider view of this page.

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


A fast, very low-maintenance, 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 Organzir 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 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.
  • Consider using my Manjaro Gnome Post-Install script. For example, it will automatically configure RDP, which is very handy for your server (you will be required to set credentials during script execution). I use this script for all my laptops/PCs also for family and friends, regardless if it is a media/NAS server or just home PC.

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

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

Read through the prep_docker.sh and see what it does (everything has comments). The PREP_DOCKER.SH script is 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 (Docker Rootless Mode) and all but 1 tools will be installed via the Manjaro or AUR repository --> they will be automatically updated by the OS official repositories (compare that to Ubuntu/Debian based systems).

Download and install it via:

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

Note

  • A subvolume for Docker will be created --> allows extremely easy daily or hourly backups and recovery.
  • Installs Docker in rootless mode for enhanced security. This reduces the attack serface of your server.
  • 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 - Filesystem configuration

Prepare the drives. Understand your goal, make sane choices for your drives and create a datapool.

Step 3 - Network configuration

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

Step 4 - 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 5. Data Migration & Folder Structure

Move files to your server data pool and create your folder structure. Note my folder structure might not fit your needs. It's up to you to decide how to structure your data.

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. Overview of Docker Apps contains direct links to the documentation or homepage of each Docker app.

Step 7 - Configure & schedule Maintenance

Nightly maintenance of your server such as cleanup, backup and disks protection tasks.

Step 8 - Configure & schedule Backups

Decide what will be your Backup Strategy and use the Server Backup Guide to leverage the BTRFS filesystem to backup your @, @home, @docker subvolumes and your data subvolumes easily, while also having a timeline/timemachine snapshots of your data.