Post

Home Server Setup Guide

A simple step by step server setup guide

Home Server Setup Guide

Sever OS (preffered) - Ubuntu Pro

Server Configuration

Upgrade the server:

1
sudo apt update && apt upgrade -y

To fix apt key deprecations errors on Ubuntu:

1
2
cd /etc/apt
cp trusted.gpg trusted.gpg.d

Enable Root SSH (Not Recommended):

1
2
3
nano /etc/ssh/sshd_config
PermitRootLogin yes
systemctl restart sshd

Now for UI, prefer low resource consuming session-manager. Check below xfce minimal install.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
apt install \
    libxfce4ui-utils \
    xfce4-appfinder \
    xfce4-panel \
    xfce4-session \
    xfce4-settings \
    xfce4-terminal \
    xfconf \
    xfdesktop4 \
    xfwm4 \
    nautilus \
    nautilus-share \
    xrdp \
    gnome-disk-utility \
    git \
    selinux-utils \
    selinux-basics \
    auditd \
    audispd-plugins \
    synaptic \
    gdebi \
    unzip \
    featherpad \
    dbus-x11 (only incase of dbus issue)

Now we have to enable xfce as a default session manager.

1
sudo update-alternatives --config x-session-manager

And select xfce-session.

Buy Domain

Purchase domain of your choice or use already existing domain, it will help in accessing your hosted services outside your home network.

Tunnel Configuration - Reverse Proxy (Incaase of Dynamic IP)

CLOUDFLARE: Create an free a/c, install client and enable reverse proxy. Reffer: https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/

VPN Configuration

Premium VPN service - Nordvpn:

1
sh <(curl -sSf https://downloads.nordcdn.com/apps/linux/install.sh)

NordVPN Usage:

1
2
3
4
5
6
nordvpn login
nordvpn set autoconnect on in164
nordvpn set meshnet on
nordvpn set lan-discovery enable
nordvpn meshnet peer local allow "meshdevice1"
nordvpn meshnet peer routing allow "meshdevice1"

Open Source VPN service - OpenVPN:

1
2
3
4
5
cd /etc/openvpn
sudo wget https://downloads.nordcdn.com/configs/archives/servers/ovpn.zip
sudo unzip ovpn.zip
sudo rm ovpn.zip
cd ovpn_udp && ls -al

Getting creds from text file:

1
2
sudo cp /etc/openvpn/ovpn_udp/uk2169.nordvpn.com.udp.ovpn /etc/openvpn/uk2169.conf
sudo nano /etc/openvpn/uk2169.conf

Find line: auth-user-pass Change to: auth-user-pass auth.txt

1
sudo nano auth.txt

Add nordvpn user name and password in auth.txt as shown in below format. username password

1
2
3
4
sudo nano /etc/default/openvpn
AUTOSTART="all"
sudo reboot
sudo systemctl enable NetworkManager.service

Tools Installation

Radarr: Movie organizer/manager for usenet and torrent users. Radarr Direct Install

Sonarr: Smart PVR for newsgroup and bittorrent users. Sonarr Direct Install

Jackett: API Support for your favorite torrent trackers.

1
sudo apt-get install libcurl4-openssl-dev bzip2 mono-devel

Go to https://github.com/Jackett/Jackett/releases, copy the latest Jackett.Binaries.Mono.LinuxAMD64.tar.gz link.

1
2
3
4
5
6
7
8
cd /tmp/
wget https://github.com/Jackett/Jackett/releases/download/v0.14.365/Jackett.Binaries.LinuxAMDx64.tar.gz
tar -xvf Jackett.Binaries.LinuxAMDx64.tar.gz 
sudo mkdir /opt/jackett
sudo mv Jackett/* /opt/jackett/
sudo chown -R abhi:root /opt/jackett/
cd /opt/jackett/
./jackett

Runs OK? Then you can opt in to start Jackett at boot. Let us execute service systemd script to configure this:

1
2
3
./jackett sudo ./install_service_systemd.sh
sudo systemctl status jackett.service
sudo systemctl enable jackett.service

Portainer: Making Docker and Kubernetes management easy.

1
2
docker volume create portainer_data
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest

Cop-Paste below template for docker store.

Templete: https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json

Yacht: A web interface for managing docker containers with an emphasis on templating to provide 1 click deployments. Think of it like a decentralized app store for servers that anyone can make packages for.

1
2
docker volume create yacht
docker run -d -p 8001:8001 -v /var/run/docker.sock:/var/run/docker.sock -v yacht:/config --name yacht selfhostedpro/yacht

Casa OS: A simple, easy-to-use, elegant open-source Personal Cloud system.

1
curl -fsSL https://get.casaos.io | sudo bash

Plex Media Server: Allows you to organize and stream your collection of movies, TV shows, music, and photos, from a central location.

1
2
3
echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -
apt update && apt install plexmediaserver -y

Tautulli: Tautulli is the best web application to monitor, view analytics, and receive notifications about your Plex Media Server.

1
2
3
4
5
6
7
8
9
docker volume create tautulli_config
docker run -d \
  --name=tautulli \
  -p 8181:8181 \
  -v tautulli_config:/config \
  -e PUID=$(id -u) \
  -e PGID=$(id -g) \
  --restart unless-stopped \
linuxserver/tautulli

QBitorrent: Download Manager

1
2
add-apt-repository ppa:qbittorrent-team/qbittorrent-stable && \
apt install -y qbittorrent qbittorrent-nox

To auto start Qbitorrent on boot. Run below command.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
cat > /etc/systemd/system/qbittorrent-nox.service << EOF
[Unit]
Description=qBittorrent Command Line Client
After=network.target

[Service]
Type=forking
User=root
Group=root
UMask=000
ExecStart=/usr/bin/qbittorrent-nox -d --webui-port=6969
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF
1
2
3
4
5
systemctl daemon-reload && \
systemctl enable qbittorrent-nox && \
systemctl stop qbittorrent-nox && \
systemctl start qbittorrent-nox && \
systemctl status qbittorrent-nox

Default username and password: admin/adminadmin

Troubleshoot : 1.Incase of password fail issue; stop the service and add the below entry to config file.

1
2
3
nano ~/.config/qBittorrent/qBittorrent.conf
Add
WebUI\Password_PBKDF2="@ByteArray(ARQ77eY1NUZaQsuDHbIMCA==:0WMRkYTUWVT9wVvdDtHAjU9b3b7uB8NR1Gur2hmQCvCDpm39Q+PsJRJPaCU51dEiz+dTzh8qbPsL8WkFljQYFQ==)"

2.Stop the service add the above line then start the service.

3.Now you can use “adminadmin” as password.

Kasm: A platform provides enterprise-class orchestration, data loss prevention, and web streaming technology to enable the delivery of containerized workloads to your browser.

1
2
3
4
cd /tmp
curl -O https://kasm-static-content.s3.amazonaws.com/kasm_release_1.15.0.06fdc8.tar.gz
tar -xf kasm_release_1.15.0.06fdc8.tar.gz
sudo bash kasm_release/install.sh
This post is licensed under CC BY 4.0 by the author.