Raspberry Pi5 setup script
This script is from my personal collection. If this is useful for you, feel free to use it.
Tested on Raspberry Pi OS
built on Debian Bookworm
, your mileage may vary.
sudo apt update -y;
sudo apt upgrade -y;
sudo apt dist-upgrade -y;
sudo apt install curl wget build-essential libssl-dev -y;
# setting up ZSH and setting it as default shell
# sudo apt install zsh -y;
# cat /etc/shells;
# chsh -s "/bin/zsh";
sudo apt install git neofetch lsd autojump ripgrep fd-find htop btop jq yq ufw unzip -y;
# configure autojump
# https://github.com/wting/autojump
echo "# enable autojump" >> ~/.bashrc
echo "[ -f /usr/share/autojump/autojump.sh ] && . /usr/share/autojump/autojump.sh" >> ~/.bashrc
echo "# enable autojump" >> ~/.bash_profile
echo "[ -f /usr/share/autojump/autojump.sh ] && . /usr/share/autojump/autojump.sh" >> ~/.bash_profile
# install mariadb
sudo apt install mariadb-server mariadb-client -y;
sudo mysql_secure_installation;
# install redis-server
sudo apt install redis-server -y;
sudo systemctl enable redis-server;
# install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
# install starship
# https://starship.rs/
curl -sS https://starship.rs/install.sh | sh
starship preset gruvbox-rainbow -o ~/.config/starship.toml
# install cloudflared
curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64.deb && \
sudo dpkg -i cloudflared.deb
# install bash completion
sudo apt-get install bash-completion
echo "source /usr/share/bash-completion/bash_completion" >> ~/.bashrc
source ~/.bashrc
# setting up docker
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done
# 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
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
# install golang
echo "export GOARCH=arm64" >> $HOME/.bashrc
echo "export GOOS=linux" >> $HOME/.bashrc
wget https://go.dev/dl/go1.21.6.linux-arm64.tar.gz
tar -xvf go1.21.6.linux-arm64.tar.gz
# rm -rf go1.21.6.linux-arm64.tar.gz
mv go ~/.local/share
echo 'export GOPATH=$HOME/.local/share/go' >> ~/.bashrc
echo 'export PATH=$HOME/.local/share/go/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
# install golang
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.21.6.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" > $HOME/.bashrc
# install bunjs
curl -fsSL https://bun.sh/install | bash
# install gum
# https://github.com/charmbracelet/gum
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
sudo apt update;
sudo apt install gum -y;
# install anaconda
wget https://repo.anaconda.com/archive/Anaconda3-2023.09-0-Linux-aarch64.sh;
chmod +x Anaconda3-2023.09-0-Linux-aarch64.sh;
./Anaconda3-2023.09-0-Linux-aarch64.sh;
rm -rf Anaconda3-2023.09-0-Linux-aarch64.sh;
# install casaos
# https://casaos.io/
curl -fsSL https://get.casaos.io | sudo bash
# configure UFW
sudo ufw status;
sudo ufw default deny incoming;
sudo ufw default allow outgoing;
sudo ufw allow SSH;
sudo ufw allow VNC;
sudo ufw allow WWW Full;
sudo ufw allow 80/tcp;
sudo ufw allow 443/tcp;
sudo ufw enable;
sudo ufw status numbered;
# install tailscale
# https://tailscale.com/
# curl -fsSL https://tailscale.com/install.sh | sh
# cleanup
sudo apt autoremove -y;
sudo apt autoclean -y;
sudo apt autopurge -y;
# reboot system
sudo reboot;
# additional to install
# nvim => https://www.lazyvim.org/