Installing Umbrel on an Odroid HC4

The hardware

The Odroid HC4 is self-contained, it can boot from a SATA SSD, doesn’t need any adapters, cables, SD cards, workarounds or other stuff. It has a 64-bit Cortex-A55 processor, 4 GB of ram and two fixed SATA connections. This guide should also work on the almost identical Odroid C4, minus the case. It might also work on other 64-bit Arm SBCs as well, such as the Rock Pi 4 or NanoPi R4S. The Odroid HC1/HC2 is not supported, as those have a 32-bit CPU.

The Odroid HC4 comes with a toaster model case. This is a convenient form factor, not pretty, but simple and effective. No wires, just jam the drive into the slot. With 2.5" drives it’s awkward. So good.

With $65, it’s in the same price region as a Raspberry Pi 4. For the version with a small screen you pay $10 more. Final thing is a beefy barrel plug power supply for $9.40, and of course shipping costs.

In this guide, I’ve used a 1 TB Samsung 860 QVO SSD, purchased for €99 in mid 2020. Currently, a 1 TB SSD starts around $90,-. The dual SATA connection uses a direct PCIe bridge, instead of a USB bridge. This gives two benefits: it has better compatibility and can boot from the SSD.

Total cost of hardware is ~$165.

Umbrel

The software

Why Umbrel? It’s a slick interface, defaults all traffic over tor, has an app store so you can easily add f.e. BTCPay Server or Specter Desktop.

Out of the box, the Raspberry Pi 4 is supported with pre-baked images, but as it’s docker container based, it should be relatively simple to follow the custom installation guidelines from Umbrel.

It needs docker, docker-compose, python3, and some other bits and bobs.

The OS

First, download the latest Ubuntu minimal 20.04 LTS from the Odroid wiki:

odroid-hc4:os_images:ubuntu [ODROID Wiki]

Flash the downloaded image with Balena Etcher or (oh the irony) Raspberry Imager. You can use any USB enclosure or SATA adapter. So yes, you need one, briefly, but only for this part.

Balena Etcher

Alternative: if you don’t have a USB SATA adapter or enclosure, you can work around this by flashing Ubuntu Mate on a SD card and use the HC4 itself to prepare the SSD. It’s a bit more cumbersome, but should work. The SD card is only temporary.

First boot

After the imaging, stick the SSD in the toaster, connect a network cable, power it up and wait ~1 minute for it to boot. As part of first boot it will automatically resize partitions to use the whole disk. Log in with:

ssh root@odroid

The default password is odroid.

First login

Dependencies

Now that you’re logged in, first the system needs to be upgraded to all the latest packages and install the required dependencies:

apt-get update
apt-get full-upgrade
apt-get install fswatch jq rsync curl python3 python3-pip
apt autoremove

This also cleans some superfluous packages.

Swapfile

By default the OS doesn’t have a swapfile, without this, some components can’t run properly. Creating a swapfile of 4GB should be sufficient:

dd if=/dev/zero of=/swapfile bs=1M count=4096
chmod 0600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab

Hostname and username

The hostname is changed to umbrel.

hostnamectl set-hostname umbrel
echo umbrel > /etc/hostname

It is not mandatory to change this to umbrel, but this works around a small (non-critical) UI issue in the current version. More on this later.

Also, change the root login password with:

passwd

Lastly, create a user and add the user to the sudo group:

adduser umbrel
adduser umbrel sudo

Second boot

To let the hostname and other settings take effect, the machine needs to be rebooted:

reboot

After a minute or so, you can login again with the new username, hostname and the new password:

ssh umbrel@umbrel

Docker

Next up is installing docker:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh ./get-docker.sh
sudo usermod -aG docker umbrel

For the last one to take effect, you need to log off and on again.

exit
ssh umbrel@umbrel

And finally, install docker-compose and qrcode:

sudo pip3 install docker-compose qrcode

This one takes a bit longer, Building wheel for pynacl takes several minutes.

Umbrel

For the installation of Umbrel, create a folder, download the latest version and start it.

mkdir umbrel
cd umbrel
curl -L https://github.com/getumbrel/umbrel/archive/v0.3.1.tar.gz | tar -xz --strip-components=1
sudo ./scripts/start

This takes a while on first run, as it has to download the world.

Umbrel continued

When it’s done, after a few minutes, go to your browser and navigate to http://umbrel/ (or the hostname you picked) where you will be greeted by a welcome screen:

welcome to umbrel

From here, Umbrel takes over with a super slick on-boarding process.

Important: note down your secret words!

One last thing: #cwiaf

After the on-boarding, it starts downloading and validating the complete bitcoin blockchain. It takes a bit before the percentage progress starts, as it first downloads block headers. To see what’s happening under the hood you can view logs . On the bitcoin tab under the menu on the right, select View logs.

If the hostname is something other than umbrel, the logs initially don’t show anything. This is fixed by changing umbrel in the filter in the top right to your hostname.

Initial block download

After the block headers are downloaded, you’ll see the progress on the dashboard.

Synchronising

The initial version of this guide was written in real time. I did one trail run, re-imaged the disk, redid the whole thing, including screenshots in about 1 hour. Even before the initial block download is finished everything should be usable already, due to some cleverness from the Umbrel developers.

The header download took 10 minutes. The first 210000 blocks, up to the first halving, took 81 minutes to download and validate.

210000 blocks done

The second halving, the next 210000 blocks, took 12 hours. Total progress at that point is 23%.

After 34 hours, 50% of the work is done. It verified the transactions of the busy 2017 hype cycle.

After 86 hours, the end of the sync:

Have fun getting Umbrel!

Restart on boot

Umbrel comes with a service script, so it will automatically restart on boot.

sudo ln -s /home/umbrel/umbrel/scripts/umbrel-os/services/umbrel-
startup.service /etc/systemd/system/umbrel-startup.service
sudo systemctl enable umbrel-startup

After a reboot, make sure to log in on the web UI to unlock the lightning wallet.

Bonus section

If you have the Odroid HC4 with OLED screen, I have just the right stuff for you.

The right stuff

First the dependencies need to be installed:

sudo apt-get install git libjpeg-dev zlib1g-dev libfreetype6-dev

and python packages:

sudo pip3 install --upgrade Pillow

As this script is not root, we have to add permissions for this user to access the display on the i2c-0 port:

sudo groupadd i2c
sudo chown :i2c /dev/i2c-0
sudo chmod g+rw /dev/i2c-0
sudo usermod -aG i2c umbrel

After that, clone the odroid-homecloud-bitcoin project:

git clone https://github.com/mutatrum/odroid-homecloud-bitcoin.git

For this script to be able to connect to the bitcoin daemon, you first need to find the ip address:

docker logs bitcoin | grep " bind="

Secondly, it needs the RPC Username and Password. These can be found in the Umbrel interface, on the bitcoin tab. Open the on the right side, select Connect wallet. As wallet type, select Bitcoin Core RPC and note down the RPC Username and RPC Password.

These need to be filled in in the script. Open the script in nano:

nano ./odroid_homecloud_display/clock.py

Fill in the IP address, RPC username and password:

Use ^O to save and ^X to exit.

Finally, the project can be built and installed:

cd odroid-homecloud-bitcoin
python3 setup.py install

The supplied service file is not suitable for umbrel. Create a new file:

sudo nano /etc/systemd/system/odroid-homecloud-display.service

with the following content:

[Unit]
Description=Display daemon for ODROID Homecloud
Wants=umbrel-startup.service
After=umbrel-startup.service

[Service]
Type=simple
ExecStart=/usr/local/bin/odroid_homecloud_display
User=umbrel
Group=umbrel

[Install]
WantedBy=multi-user.target

And as final step, enable and start the service:

sudo systemctl daemon-reload
sudo systemctl enable odroid-homecloud-display
sudo systemctl start odroid-homecloud-display

Summary

For clarity, you can find all commands in this gist.

# first boot
ssh root@odroid

# dependencies
apt-get update
apt-get full-upgrade
apt-get install fswatch jq rsync curl python3 python3-pip
apt autoremove

# swapfile
dd if=/dev/zero of=/swapfile bs=1M count=4096
chmod 0600 /swapfile
mkswap /swapfile
swapon /swapfile

# hostname and username
hostnamectl set-hostname umbrel
echo umbrel > /etc/hostname
passwd
adduser umbrel
adduser umbrel sudo

# second boot
reboot
ssh umbrel@umbrel

# docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh ./get-docker.sh
sudo usermod -aG docker umbrel
exit
ssh umbrel@umbrel
sudo pip3 install docker-compose qrcode

# umbrel
mkdir umbrel
cd umbrel
curl -L https://github.com/getumbrel/umbrel/archive/v0.3.1.tar.gz | tar -xz --strip-components=1
sudo ./scripts/start

# restart on boot
sudo ln -s /home/umbrel/umbrel/scripts/umbrel-os/services/umbrel-startup.service /etc/systemd/system/umbrel-startup.service
sudo systemctl enable umbrel-startup

Original post

This guide was initially posted in a twitter thread: https://twitter.com/mutatrum/status/1346103275632926722

And later adapted to medium: https://mutatrum.medium.com/installing-umbrel-on-an-odroid-hc4-ef2ce9dc8537