Skip to content

Instantly share code, notes, and snippets.

@TradeClaw
Forked from mayankchhabra/umbrel-ubuntu-20-04-x86.md
Last active April 3, 2024 16:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save TradeClaw/d326de0bb0eb0b3ffdbc4542b69b0c0f to your computer and use it in GitHub Desktop.
Save TradeClaw/d326de0bb0eb0b3ffdbc4542b69b0c0f to your computer and use it in GitHub Desktop.
Installing Umbrel on Ubuntu 20.04

Install Ubuntu Server 20.04

There is no guarantee this guide will work flawless on earlier or later versions of Ubuntu!

  • 1 CPU & 4GB RAM minimum (more CPU helps initial sync)
  • 1TB SSD disk minimum
  • Resize ubuntu-lv to 50G
  • Create new umbrel-lv for the remaining space and new mount /umbrel
  • Select 'Install OpenSSH Server'
  • Do NOT choose the docker feature, this will be installed manually
  • Reboot after security patching finishes
  • Login via SSH

Install Umbrel

sudo apt update -y
# In case you want, you can upgrade packages, but do NOT upgrade the OS level from 20.04!
# sudo apt update -y
sudo apt-get install -y fswatch jq rsync curl
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod a+x /usr/local/bin/yq
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo chown $USER:$USER /umbrel
cd /umbrel
curl https://api.github.com/repos/getumbrel/umbrel/releases/latest | grep "tarball_url" | grep -Eo 'https://[^\"]*' | xargs curl -L | tar -xz --strip-components=1
# If you want to install a specific version: 
# curl -L https://github.com/getumbrel/umbrel/archive/v0.5.1.tar.gz | tar -xz --strip-components=1
sudo ./scripts/start
# Now is the time to copy over another bitcoin/blocks and bitcoin/chainstate folder before you install the Bitcoin app
# Before v0.5.0 the Bitcoin application data was stored under /umbrel/bitcoin
# Since v0.5.0 the Bitcoin application data is stored under /umbrel/app-data/bitcoin/data/bitcoin
# From the original (source) server, login to SSH and execute: 
# (Source in the example is a <v0.5, adjust paths accordingly)
# rsync -azvh /umbrel/bitcoin/blocks umbrel@newservername:/umbrel/app-data/bitcoin/data/bitcoin 
# rsync -azvh /umbrel/bitcoin/chainstate umbrel@newservername:/umbrel/app-data/bitcoin/data/bitcoin
# (split the commands because of the time-out in between copying when using &&)
################
# Once these files are copied over, install the Bitcoin app

Create service file (automatic startup)

Should be at https://github.com/getumbrel/umbrel/blob/master/scripts/umbrel-os/services/umbrel-startup.service

cd /etc/systemd/system/
sudo wget https://raw.githubusercontent.com/getumbrel/umbrel/master/scripts/umbrel-os/services/umbrel-startup.service
sudo nano umbrel-startup.service
  • Edit the file to become like this:
# Umbrel Startup Service
# Installed at /etc/systemd/system/umbrel-startup.service

[Unit]
Description=Umbrel Startup Service
Wants=network-online.target
After=network-online.target
Wants=docker.service
After=docker.service

# This prevents us hitting restart rate limits and ensures we keep restarting
# indefinitely.
StartLimitInterval=0

[Service]
Type=forking
TimeoutStartSec=infinity
TimeoutStopSec=16min
ExecStart=/umbrel/scripts/start
ExecStop=/umbrel/scripts/stop
User=root
Group=root
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=umbrel startup
RemainAfterExit=yes
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
  • Exit Nano (CTRL+X), save
  • Enable the service
sudo systemctl enable umbrel-startup.service

Install Guest Tools if Ubuntu is running on a VM

  • Synology Virtual Machine
sudo apt-get install -y qemu-guest-agent

Enable automatic security patching

sudo apt install -y unattended-upgrades apt-listchanges
sudo dpkg-reconfigure -plow unattended-upgrades
sudo nano /etc/apt/apt.conf.d/50unattended-upgrades
sudo unattended-upgrades --dry-run

Upgrade/downgrade to a specific Umbrel version

sudo /umbrel/scripts/update/update --repo getumbrel/umbrel#v0.5.2

Reset installation

# Please realize that you also need to backup any other configs (channel state f.e.) or whatever comes in the future.
cd /umbrel
sudo systemctl stop umbrel-startup && sudo rm -rf /umbrel/lnd/!(lnd.conf) && sudo rm -f /umbrel/db/user.json && sudo rm -f /umbrel/db/umbrel-seed/seed && sudo systemctl start umbrel-startup
# update manually to the version you want (example 0.5.0)
sudo ./scripts/update/update --repo getumbrel/umbrel#0.5.0
@L3and3r
Copy link

L3and3r commented Dec 23, 2022

I keep getting this error:

odroid@umbrel:$ sudo apt-get install -y fswatch jq rsync curl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
jq is already the newest version (1.6-2.1ubuntu3).
fswatch is already the newest version (1.14.0+repack-13.1).
curl is already the newest version (7.81.0-1ubuntu1.6).
rsync is already the newest version (3.2.3-8ubuntu3.1).
The following packages were automatically installed and are no longer required:
libflashrom1 libftdi1-2 libssl1.1 wmdocker
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up docker-ce (5:20.10.22
3-0~ubuntu-jammy) ...
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xeu docker.service" for details.
invoke-rc.d: initscript docker, action "start" failed.
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Fri 2022-12-23 08:34:09 UTC; 37ms ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Process: 2879 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 2879 (code=exited, status=1/FAILURE)
CPU: 465ms
dpkg: error processing package docker-ce (--configure):
installed docker-ce package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)

@TradeClaw
Copy link
Author

I keep getting this error:

odroid@umbrel:$ sudo apt-get install -y fswatch jq rsync curl Reading package lists... Done Building dependency tree... Done Reading state information... Done jq is already the newest version (1.6-2.1ubuntu3). fswatch is already the newest version (1.14.0+repack-13.1). curl is already the newest version (7.81.0-1ubuntu1.6). rsync is already the newest version (3.2.3-8ubuntu3.1). The following packages were automatically installed and are no longer required: libflashrom1 libftdi1-2 libssl1.1 wmdocker Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up docker-ce (5:20.10.223-0~ubuntu-jammy) ... Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xeu docker.service" for details. invoke-rc.d: initscript docker, action "start" failed. ● docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: activating (auto-restart) (Result: exit-code) since Fri 2022-12-23 08:34:09 UTC; 37ms ago TriggeredBy: ● docker.socket Docs: https://docs.docker.com Process: 2879 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE) Main PID: 2879 (code=exited, status=1/FAILURE) CPU: 465ms dpkg: error processing package docker-ce (--configure): installed docker-ce package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: docker-ce E: Sub-process /usr/bin/dpkg returned an error code (1)

You are running Ubuntu 22.04, not Ubuntu 20.04.
I was thinking of cloning and adapting the guide for 22.04 but haven't had the time.
Docker installation is different, think this will get you started: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment