- Use Rapsberry pi Imager to burn os to sd card
- Make sure to install
Raspberry Pi OS Lite 64-bit
- Username -
pi
- Go to ~/.shh folder on your pc and copy the public ssh key you want to use
- Ssh to raspberrypi using password, then run the following commands
mkdir .ssh
cd .ssh
touch authorized_keys
nano authorized_keys
sudo apt update && sudo apt upgrade
Run the following command to uninstall all conflicting packages:
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
- Set up Docker's apt repository.
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
- Install the Docker packages.
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
- Added User to Docker Group -
sudo groupadd docker
sudo usermod -aG docker $USER
Refrence - https://docs.docker.com/engine/install/debian/
- Check for interface name
nmcli con show
Copy the name
of wifi type.
2. Backup original Settings
sudo nmcli con show "Name that you copied" | tee original_network_settings.txt
- Add the prefered static ip
sudo nmcli con mod "Name that you copied" ipv4.method manual ipv4.addr 192.168.1.50/24
sudo nmcli con mod "Name that you copied" ipv4.addr 192.168.1.50/24 ipv4.gateway 192.168.1.1 ipv4.dns 1.1.1.1 ipv4.method manual
Refrence - https://nitratine.net/blog/post/how-to-set-a-static-ip-address-on-a-raspberry-pi-5/
if command -v curl >/dev/null 2>&1; then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/romkatv/zsh4humans/v5/install)"
else
sh -c "$(wget -O- https://raw.githubusercontent.com/romkatv/zsh4humans/v5/install)"
fi
Refrence - https://github.com/romkatv/zsh4humans
ssh-keygen -t ed25519 -C "[email protected]"
Use homelab_gh
for key name.
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/homelab_gh
Refrences - Ref 1
Follow this guide - https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale login
- To enable local network access / exit node from raspberry pi -
echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
sudo sysctl -p /etc/sysctl.d/99-tailscale.conf
- Now, Enable subnet routes from the admin console
- Now run the following command on the pi -
sudo tailscale up --advertise-routes=192.168.0.0/24,192.168.1.0/24 --advertise-exit-node
NETDEV=$(ip route show 0/0 | cut -f5 -d' ')
sudo ethtool -K $NETDEV rx-udp-gro-forwarding on rx-gro-list off
Changes made via ethtool are not persistent and will be lost after the machine shuts down. On Linux distributions using networkd-dispatcher (which you can verify with systemctl is-enabled networkd-dispatcher), copy and run the following commands to create a script that will configure these settings on each boot.
printf '#!/bin/sh\n\nethtool -K %s rx-udp-gro-forwarding on rx-gro-list off \n' "$(ip route show 0/0 | cut -f5 -d" ")" | sudo tee /etc/networkd-dispatcher/routable.d/50-tailscale
sudo chmod 755 /etc/networkd-dispatcher/routable.d/50-tailscale
Test the created script to ensure it runs successfully on your machine:
sudo /etc/networkd-dispatcher/routable.d/50-tailscale
test $? -eq 0 || echo 'An error occurred.'
Ref - https://tailscale.com/kb/1019/subnets , https://tailscale.com/kb/1320/performance-best-practices
Go to Cloudflare Dashboard
> Zero Trust
> Networks
> Tunnels
then configure.
sudo mkdir -p /etc/apt/keyrings
sudo curl -L -o /etc/apt/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg
echo "deb [signed-by=/etc/apt/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
# Update and install syncthing:
sudo apt-get update
sudo apt-get install syncthing
Refrence - https://apt.syncthing.net/
sudo systemctl enable [email protected]
sudo systemctl start [email protected]