HomeLab On Raspberry Pi 4

A Docker Based Server!

·

4 min read

HomeLab On Raspberry Pi 4

This Article is a collection of steps for hosting a variety of server applications using Docker and Portainer on RaspberryPi.

Prerequisite

Installing Operating System

I recommend the use of Raspberry Pi Imager to install an operating system onto your SD card. You will need another computer with an SD card reader to install the image. Raspberry Pi Imager can be run on another Raspberry Pi, but also works on Microsoft Windows, Apple macOS, and Linux.

USING RASPBERRY PI IMAGER

Raspberry Pi has developed a graphical SD card writing tool that works on Mac OS, Ubuntu 18.04, and Windows called Raspberry Pi Imager; this is the easiest option for most users since it will download the image automatically and install it to the SD card.

Download the latest version of Raspberry Pi Imager and install it. If you want to use Raspberry Pi Imager from a second Raspberry Pi, you can install it from a terminal using "sudo apt install rpi-imager". Then:

  • Connect an SD card reader with the SD card inside.

  • Open Raspberry Pi Imager and choose the Raspberry Pi OS Lite (64bit) from the list presented.

  • Choose the SD card you wish to write your image to.

  • After you have selected the operating system to install, a cog wheel will appear allowing you to open an "Advanced Options" menu.

  • Set the Hostname as raspberry.local and Enable SSH(password authentication) and Configure Wifi(Optional) and configure the User on the advanced options.

  • Review your selections and click on the Write button to begin writing data to the SD Card.

Post OS Installation

Connect the SD Card to the Raspberry PI 4 and assemble the Pi inside its case and attach the heat sink and fan.

Connect the Raspberry pi into the network using Ethernet(Recommended) or WiFi.

SSH into the Pi using the raspberrypi.local hostname or the corresponding IP address of pi given by the Router/DHCP server.

Update and Upgrade the Raspberry Pi using the code below

sudo apt update && sudo apt upgrade -y

Installation of Docker and Portainer.

Run install_docker.sh, to install docker, and add the current user to the docker usergroup.

wget -qO- https://raw.githubusercontent.com/akkupy/Homelab/main/scripts/install_docker.sh | bash

You need to reboot/logout for changes to take effect.

Reboot for changes to take effect

sudo reboot

After a reboot, run install_portainer.sh, to install Portainer.io

wget -qO- https://raw.githubusercontent.com/akkupy/Homelab/main/scripts/install_portainer.sh | bash

Login to Portainer.

  • Goto raspberry_ip:9000 and then login.

  • Now just click App Templates and deploy applications!

Update Portainer Script.

wget -qO- https://raw.githubusercontent.com/akkupy/Homelab/main/scripts/update_portainer.sh | bash

List of Documentation files.

List of all Documents used within this project.


File NameDescription
tailscale.mdInstall and setup instructions for Tailscale(A VPN Service)
nginx_proxy_manager.mdInstall and setup instructions for Nginx Proxy Manager (NPM)
Self-signed SSL CertificateFollow these steps for SSL Certificate Authority for Local Https Development(can be used with NPM)
pi-hole.mdInstall and Setup Pi-Hole for Network-Wide Ad Block
vaultwarden.mdInstall and Setup Vaultwarden, A privately hosted password manager
rpimonitoring.mdInstall and Setup Raspberry Pi & Docker Monitoring, A user-friendly way to monitor the performance of your Raspberry Pi
jellyfin.mdInstall and Setup Jellyfin, A Software to provide media from a dedicated server to end-user devices via multiple apps
filebrowser.mdInstall and Setup Filebrowser, A file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files
heimdall.mdInstall and Setup Heimdall, Organise all those links to your most used websites and web applications in a simple way.
qbittorrent.mdInstall and Setup Qbittorrent, An open-source software alternative to µTorrent.
sonarr.mdInstall and Setup sonarr, a PVR for Usenet and BitTorrent users.
radarr.mdInstall and Setup radarr, A fork of Sonarr to work with movies à la Couchpotato.
jackett.mdInstall and Setup jackett, translates queries from apps (Sonarr, SickRage, CouchPotato, Mylar, etc) into tracker-site-specific HTTP queries, parses the html response, and then sends results back to the requesting software.
nextcloud.mdInstall and Setup Nextcloud, A safe home for all your data. Access & share your files, calendars, contacts, mail & more from any device, on your terms.
Z-VoteInstall and Setup Z-Vote, A Blockchain-based Voting System

Did you find this article valuable?

Support Akash S by becoming a sponsor. Any amount is appreciated!