Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JamesMarino/0351d00611769ebbc8a16d74aba18bf3 to your computer and use it in GitHub Desktop.
Save JamesMarino/0351d00611769ebbc8a16d74aba18bf3 to your computer and use it in GitHub Desktop.
Install Home Assistant on Raspberry Pi with No Micro SD Card

Install Home Assistant on Raspberry Pi with No Micro SD Card

Unfortunately I did not have a USB C to Micro SD adapter available so things had to be done the hard way.

  1. Live Boot from Thumbdrive using the Raspberry Pi Imager to load the OS on the thumbdrive
  2. Add an empty file named ssh in the root boot directory
  3. SSH into the machine, check device address on router and ssh [email protected] with password raspberry

Run the following on the Raspberry Pi after SSH'ing into it.

  1. Phsyically insert the Micro SD card into the Pi Now
  2. curl https://github.com/home-assistant/operating-system/releases/download/6.1/haos_rpi4-6.1.img.xz -o home-assistant.img.xz - See here for reference
  3. unxz home-assistant.img.xz
  4. lsblk -p
  5. sudo dd if=home-assistant.img of=/dev/mmcblk0 bs=4M conv=fsync
  6. Turn off the machine, remove thumbdrive and reboot
  7. Access Home Assistant at http://10.X.X.X:8123

How to Add a Swap

This example allocates 4GB of Swap

sudo fallocate -l 4G /swapfile
sudo dd if=/dev/zero of=/swapfile bs=1024 count=4M
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show

# Optional
sudo sysctl vm.swappiness=10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment