Skip to content

RohitRajeshvdy/Raspi_Home_Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ Raspberry Pi 4 Home Server Setup

A self-hosted, Docker-based home server running on Raspberry Pi 4. Includes media streaming, ad-blocking, automated downloads, photo management, and system monitoring.


πŸ“ Table of Contents

  1. Hardware Used

  2. Initial Raspberry Pi Setup

  3. Static IP Setup

  4. External Drive Formatting & Mounting

  5. Docker & Docker Compose Installation

  6. Remote Access

  7. Services (Docker Compose)

  8. Backups & Data Safety


πŸ› οΈ Hardware Used

  • Raspberry Pi 4 (4GB or 8GB)
  • SD Card for OS
  • External SSD/HDD (formatted to ext4)
  • Ethernet connection to router (recommended)

πŸ› οΈ Initial Raspberry Pi Setup

  1. Flash Raspberry Pi OS Lite (64-bit) using Raspberry Pi Imager.

  2. Enable SSH:

    • Enable it in the settings before flashing
  3. Connect via SSH:

    ssh pi@<raspberry_ip>

πŸ“ Static IP Setup

  1. Open the DHCP configuration file:

    sudo nano /etc/dhcpcd.conf
  2. Scroll to the bottom and add the following lines:

    interface eth0
    static ip_address=192.168.31.100/24
    static routers=192.168.31.1
    static domain_name_servers=1.1.1.1 8.8.8.8

    Replace 192.168.31.100 with your desired static IP and 192.168.31.1 with your router's IP.

  3. Save the file and reboot:

    sudo reboot

πŸ“ External Drive Formatting & Mounting

  1. Plug in your external SSD or HDD.

  2. List available disks to identify your drive (usually /dev/sda1):

    lsblk
  3. Format the drive to ext4 (WARNING: this erases all data on the drive):

    sudo mkfs.ext4 /dev/sda1
  4. Create a mount point:

    sudo mkdir -p /mnt/hdd
  5. Find the UUID of your drive:

    sudo blkid
  6. Edit the /etc/fstab file to auto-mount on boot:

    sudo nano /etc/fstab

    Add this line at the end (replace XXXX-XXXX with your actual UUID):

    UUID=XXXX-XXXX  /mnt/hdd  ext4  defaults,noatime  0  2
    
  7. Mount the drive immediately:

    sudo mount -a

🐳 Docker & Docker Compose Installation

  1. Update and upgrade your system:

    sudo apt update && sudo apt upgrade -y
  2. Install Docker using the official convenience script:

    curl -sSL https://get.docker.com | sh
  3. Add your user to the Docker group:

    sudo usermod -aG docker $USER

    Log out and back in or reboot to apply group changes.

  4. Docker Compose is now included as a plugin in modern Docker versions. You can use it like this:

    docker compose version

    No need to install it separately. Use docker compose (with a space) instead of docker-compose.

  5. Confirm installation:

    docker --version
    docker compose version

🌐 Remote Access

To access your home server from outside your local network securely, use Tailscale, a zero-config WireGuard-based VPN.

Install Tailscale:

curl -fsSL https://tailscale.com/install.sh | sh

Authenticate and Enable Subnet Routing:

sudo tailscale up --advertise-routes=192.168.31.0/24

This advertises your Raspberry Pi as a subnet router so you can access all local IP devices (e.g., 192.168.31.x) from any device in your Tailscale network.

Don't forget to approve the subnet route in the Tailscale admin panel under your Pi's device settings.

⚠️ Optional Step:

Subnet routing is not required if you're okay with accessing services using only the Pi's Tailscale IP (e.g., 100.x.x.x). In that case, you can simply use:

sudo tailscale up

Check connection:

tailscale status

After this, you can securely access your Raspberry Pi and local services using either its Tailscale IP (e.g., 100.x.x.x) or local LAN IP (e.g., 192.168.31.x).


🧩 Services

All services are organized in individual folders, each containing its own docker-compose.yml file.

πŸ“ Clone Service Repository

Create a directory for your Docker setup and clone your repository:

mkdir ~/docker
cd ~/docker
git clone https://github.com/RohitRajeshvdy/Raspi_Home_Server.git .

This will clone all folders and files from your GitHub repo into the ~/docker directory on your Raspberry Pi.


πŸ”§ Portainer

Portainer is a web UI for managing your Docker containers and stacks.

πŸ“¦ Deploy Portainer

cd ~/docker/portainer
docker compose up -d

To modify the configuration:

nano docker-compose.yml

🌐 Access Portainer

Open your browser and go to:

http://<raspberry_pi_ip>:9000

Set your admin password to complete the initial setup.


🌐 NGINX Proxy Manager

NGINX Proxy Manager provides an easy interface to manage reverse proxies, domain names, and SSL certificates.

πŸ“¦ Deploy NGINX

cd ~/docker/nginx
docker compose up -d

Access the web UI at:

http://<raspberry_pi_ip>:81
  • Default login:
  • Change credentials on first login.

πŸ›‘οΈ DuckDNS & SSL Setup

  1. Go to DuckDNS and sign in using any provider.
  2. Create a domain, e.g., yourname.duckdns.org
  3. Update the IP to your Raspberry Pi’s local IP and copy the token.

In NGINX Proxy Manager:

  1. Go to SSL Certificates β†’ Add SSL Certificate.
  2. Choose Let’s Encrypt, enter:
    • Domain Names: yourname.duckdns.org, *.yourname.duckdns.org
    • Enable DNS Challenge
    • Choose DuckDNS
    • Enter your DuckDNS token
  3. If validation fails, increase propagation delay to 30 seconds.

βœ… This is a one-time certificate setup. You do not need to repeat this for other services.

🌍 Create Proxy Host (e.g., Portainer)

  1. Navigate to Hosts β†’ Proxy Hosts β†’ Add Proxy Host
  2. Fill in:
    • Domain Names: portainer.yourname.duckdns.org
    • Forward Hostname/IP: <raspberry_pi_ip>
    • Forward Port: 9000
    • Enable:
      • Websockets Support
      • Block Common Exploits
      • Websockets Support
  3. Go to the SSL tab:
    • Select the certificate you created
    • Enable Force SSL and HTTP/2 Support

You can now access Portainer via:

https://portainer.yourname.duckdns.org

πŸ” Repeat these proxy host steps for each service you deploy below.

🚫 Pi-hole

πŸ“‚ Step 1: Navigate to the Pi-hole directory

cd ~/docker/pihole

✏️ Step 2: Edit the docker-compose file

nano docker-compose.yml

Update the following lines:

  • Change the TZ to your timezone (e.g., Asia/Kolkata)
  • Set a secure WEBPASSWORD to access the Pi-hole dashboard

Example:

    environment:
      - TZ=Asia/Kolkata
      - WEBPASSWORD=your_strong_password

Modify other settings (like ports or volumes) only if needed.

▢️ Step 3: Start Pi-hole using Docker Compose

docker compose up -d

🌐 Step 4: Access the Pi-hole Web Interface

Open your browser and visit:

http://<your-raspberry-pi-ip>:8080

Log in using the password you set in the WEBPASSWORD field.


🧠 How to Use Pi-hole for Network-Wide Ad Blocking

Choose one of the two DNS setup options below:


βœ… Option 1: Set Router DNS (Recommended)

  1. Login to your router admin panel (usually 192.168.1.1 or similar).
  2. Find the DNS settings (under LAN or DHCP settings).
  3. Set the Primary DNS to your Raspberry Pi IP (e.g., 192.168.31.100)
  4. Save and reboot the router.

This routes all devices on your network through Pi-hole automatically.


πŸ”§ Option 2: Set DNS Per Device

If router DNS change isn't possible:

  1. On each device (PC, mobile, etc), go to network settings.
  2. Manually set the DNS to your Raspberry Pi’s IP (e.g., 192.168.31.100)
  3. Leave the secondary DNS blank or use 1.1.1.1 as fallback (optional).

πŸŽ‰ Done! Pi-hole should now be actively blocking ads for your chosen devices.

πŸ“ˆ Glances

πŸ“‚ Step 1: Navigate to the Glances directory

cd ~/docker/glances

✏️ Step 2: Edit the docker-compose file

nano docker-compose.yml

Update the following line:

  • Change the TZ to your timezone (e.g., Asia/Kolkata)

Example:

    environment:
      - TZ=Asia/Kolkata

No other changes needed unless you want to adjust port mapping or volume paths.

▢️ Step 3: Start Glances using Docker Compose

docker compose up -d

🌐 Step 4: Access the Glances Web UI

Open your browser and go to:

http://<your-raspberry-pi-ip>:61208

Glances provides real-time system monitoring directly in your browser.


πŸŽ‰ Done! You now have system resource monitoring via Glances.

🟒 Uptime Kuma

πŸ“‚ Step 1: Navigate to the Uptime Kuma directory

cd ~/docker/uptime-kuma

▢️ Step 2: Start Uptime Kuma using Docker Compose

docker compose up -d

No need to edit the compose file β€” it's ready to go!

🌐 Step 3: Access the Uptime Kuma Web Interface

Open your browser and go to:

http://<your-raspberry-pi-ip>:3001

Create an admin account on first login.


πŸ“Š Step 4: Add Services to Monitor

Once inside the dashboard:

  1. Click "Add New Monitor".
  2. Enter a friendly name (e.g., "Pi-hole")
  3. Enter the URL/IP and port (e.g., http://192.168.31.100:8080)
  4. Click "Save".

Repeat this process for each service you want to monitor (e.g., Glances, Jellyfin, qBittorrent).


πŸŽ‰ Done! Uptime Kuma is now monitoring your services and will notify you of any downtime.

πŸ–ΌοΈ Immich

⚠️ Warning: Immich is resource-heavy when Machine Learning is enabled. On a Raspberry Pi 4, it works perfectly fine without Machine Learning. You can still enable it, but expect high RAM and CPU usage.

Machine Learning in Immich enables:

  • Face recognition
  • Object detection
  • Image classification
  • Auto-tagging

If you do not need these features, it's strongly recommended to comment out the entire machine-learning service in the docker-compose.yml file to keep your system responsive.


πŸ“‚ Step 1: Navigate to the Immich directory

cd ~/docker/immich

✏️ Step 2: Edit the docker-compose.yml file

nano docker-compose.yml
  • Locate the section starting with machine-learning: and comment out that entire block using #.
  • Save and exit.

πŸ› οΈ Step 3: Edit the .env file

nano .env

Update the storage path to your mounted external drive. Example:

UPLOAD_LOCATION=/mnt/hdd/immich

Make sure this folder exists. If not, create it using:

sudo mkdir -p /mnt/hdd/immich
sudo chown -R pi:pi /mnt/hdd/immich
  • mkdir -p creates the folder (including any missing parent directories).
  • chown -R pi:pi gives ownership of the folder (and all files inside) to the pi user.

▢️ Step 4: Start Immich using Docker Compose

docker compose up -d

🌐 Step 5: Access the Immich Web Interface

Open your browser and visit:

http://<your-raspberry-pi-ip>:2283

Create your admin account and start uploading and organizing your photos.


πŸŽ‰ Done! Immich is now running. Use it to back up and manage your photo library.

🧠 If you ever upgrade to a more powerful server, you can re-enable the machine learning features for smarter photo organization.

🎬 Jellyfin + 🧠 Jellyseerr

πŸ“ Step 1: Prepare Folder Structure

Before deploying Jellyfin and Jellyseerr, create the required directory structure on your external drive:

sudo mkdir -p /mnt/hdd/data/{books,movies,shows,downloads/qbittorrent/{completed/{radarr,sonarr,unsorted},incomplete/{radarr,sonarr,unsorted},torrents}}
sudo chown -R pi:pi /mnt/hdd/data

This sets up dedicated folders for all your media content and download organization.


πŸ“‚ Step 2: Navigate to the Jellyfin directory

cd ~/docker/jellyfin

✏️ Step 3: Edit the docker-compose.yml file

nano docker-compose.yml

Make the following changes:

  • Set the correct timezone for both jellyfin and jellyseerr services:
    environment:
      - TZ=Asia/Kolkata
  • Update the volume mappings to match your Raspberry Pi setup:
    volumes:
      - /home/mcper/docker/jellyfin/config:/config
      - /home/mcper/docker/jellyfin/cache:/cache
      - /mnt/hdd/data:/media

For Jellyseerr:

    volumes:
      - /home/mcper/docker/jellyfin/jellyseerr/config:/app/config

These mount paths ensure your media files and configurations are persisted and accessible by both containers.


▢️ Step 4: Start the Stack

docker compose up -d

🌐 Step 5: Access the Web Interfaces

  • Jellyfin:
http://<your-raspberry-pi-ip>:8096
  • Jellyseerr:
http://<your-raspberry-pi-ip>:5055

Set up your admin accounts and start configuring media libraries and request handling.


πŸŽ‰ Done! Jellyfin will serve your media and Jellyseerr will help users request new content to be automatically downloaded.

πŸŒͺ️ *arr Stack + qBittorrent Setup

This section covers installing and configuring the full *arr stack: qBittorrent, Sonarr, Radarr, Lidarr, Prowlarr, and Bazarr.


πŸ“‚ Step 1: Navigate to the arr directory

cd ~/docker/arr

✏️ Step 2: Edit the docker-compose.yml File

nano docker-compose.yml

Ensure all services use the correct data mount:

    volumes:
      - /mnt/hdd/data:/data

This is required for media file access and consistent storage.


βš™οΈ Step 3: Edit the .env File

nano .env

Set your timezone and user IDs:

TZ=Asia/Kolkata
PUID=1000
PGID=1000

▢️ Step 4: Start All Services

docker compose up -d

🧲 Step 5: qBittorrent Setup

After the services start, check qBittorrent logs to find the default login credentials:

docker logs qbittorrent

Access the web interface:

http://<raspberry-pi-ip>:8080

Use the credentials from the logs, then immediately change them in:

Settings β†’ Web UI β†’ Username / Password

πŸ“Ί Step 6: Configure the Other Services

  • Sonarr: http://:8989
  • Radarr: http://:7878
  • Lidarr: http://:8686
  • Bazarr: http://:6767
  • Prowlarr: http://:9696

All services are now running and accessible via your Pi’s IP address.


πŸŽ₯ Final Step: Follow Setup Video

For full configuration of the *arr automation system (Sonarr/Radarr + Prowlarr + qBittorrent), watch this video:

▢️ Automated Torrent Media Server Setup - YouTube

It covers indexers, download clients, and organizing your media end-to-end.


πŸŽ‰ Done! Your automated media server is live and ready to use.

🏠 Homarr

πŸ“‚ Step 1: Navigate to the Homarr directory

cd ~/docker/homarr

▢️ Step 2: Deploy Homarr

docker compose up -d

No file edits required β€” it's plug and play.

🌐 Step 3: Open the Dashboard

http://<raspberry-pi-ip>:7575

🧩 Step 4: Customize Your Homepage

  1. Add widgets for Jellyfin, Pi-hole, etc.
  2. Set logos, names, and links.
  3. Save the layout for quick service access.

πŸŽ‰ Homarr gives you a clean homepage to access and manage your server apps.

πŸ—‚οΈ File Browser

πŸ“‚ Step 1: Navigate to the Filebrowser Directory

Create a new directory for Filebrowser:

mkdir -p ~/docker/filebrowser
cd ~/docker/filebrowser

✏️ Step 2: Edit the docker-compose.yml File

The docker-compose.yml file already exists. Open it and edit the Filebrowser service block to:

  • Set the correct user ID (e.g., 1000:1000) based on your system.
  • Update the volumes paths to point to /mnt/hdd/filebrowser/srv , /mnt/hdd/filebrowser/config and /mnt/hdd/filebrowser/database.

πŸ“ Step 3: Create and Set Permissions on Mount Folders

Create required folders and assign proper permissions:

sudo mkdir -p /mnt/hdd/filebrowser/{srv,config,database}
sudo chown -R 1000:1000 /mnt/hdd/filebrowser

Ensures Filebrowser has access to read/write data and config files.


▢️ Step 4: Start Filebrowser

docker compose up -d

After it starts, check the container logs for default login credentials:

docker logs filebrowser

🌐 Step 5: Access the Web Interface

Open your browser and visit:

http://<your-raspberry-pi-ip>:8443

Log in using the credentials from the logs.

Once logged in, change the username and password via:

Settings β†’ User Management

πŸŽ‰ Done! You now have a simple web-based file manager accessible from your browser.

πŸ“£ - Gotify

Gotify is a simple self-hosted push notification server for sending real-time notifications.

πŸ“¦ Installation

cd gotify
docker compose up -d

πŸ” Default Credentials

  • Username: admin
  • Password: changeme

After first login, it's recommended to change the password for security.

You can now access Gotify via your browser at:

http://<your-raspberry-pi-ip>:8484

βš™οΈ Creating an Application (for Uptime Kuma & Watchtower)

  1. Log in to the Gotify web interface.
  2. Go to the Applications tab.
  3. Click Create Application.
  4. Give your app a name like uptimekuma or watchtower.
  5. Note down the generated token – this is needed for integrations.

Use this token in Uptime Kuma or Watchtower to send notifications to Gotify.


πŸ›‘οΈ - Watchtower

Watchtower automatically updates running Docker containers whenever their base images are refreshed.

πŸ“¦ Installation

cd watchtower

βš™οΈ Configuration Steps

  1. Open your existing docker-compose.yml file inside the watchtower directory.

  2. Edit the following environment variables under the watchtower service:

    • WATCHTOWER_NOTIFICATION_GOTIFY_URL: Set it to your Gotify endpoint (e.g., https://gotify.example.duckdns.org/).
    • WATCHTOWER_NOTIFICATION_GOTIFY_TOKEN: Paste the token generated from your Gotify application.
    • WATCHTOWER_DISABLE_CONTAINERS: List containers you do not want Watchtower to auto-update (e.g., gotify,file-browser,portainer,...).
    • You can also customize the schedule with WATCHTOWER_SCHEDULE (e.g., "0 1 * * *" for 1 AM daily).

▢️ Running Watchtower

docker compose up -d

Watchtower will now:

  • Monitor running containers.
  • Auto-update them based on your schedule.
  • Skip the containers you've listed.
  • Send update notifications to Gotify.

πŸ—„οΈ Backups & Data Safety

Coming soon...

About

A Guide to set up a Home Server using Raspberry Pi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published