Skip to content

Setup

Item Choice
OS Armbian Minimal (CLI), Debian 13 (Trixie)
Image Board rockpi-4bplus at https://www.armbian.com/boards/rockpi-4bplus/
Reference version Armbian 26.11.3, built on 2026-11-25
Kernel current (6.18)
Install target eMMC
Flashing tool Armbian Imager
Hostname rock-01
Time zone America/Recife
User <user>, SSH key only
  • Use only the stable image with the current kernel. Do not use edge, vendor, rolling releases or the Radxa image.
  • No desktop. Keyboard and HDMI are only for the local console.

The RK3399 boot ROM tries the eMMC before the microSD. With a system on the eMMC, the board ignores the microSD.

  1. Log in to the current system and find the eMMC (type MMC):
Terminal window
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT
cat /sys/block/mmcblk*/device/type
  1. Copy anything worth keeping (/etc, home directories, package list) to another computer.
  2. Flash the microSD (step 1).
  3. Wipe the start of the eMMC. This destroys the current system:
Terminal window
sudo dd if=/dev/zero of=/dev/mmcblkX bs=1M count=32 conv=fsync
sudo poweroff
  1. Download the Debian 13 Minimal image from the board page and check the SHA shown there.
  2. Write it to the microSD with Armbian Imager.
  1. Board powered off: microSD in the slot, Ethernet to the switch or router, keyboard receiver on the upper USB 2.0 port. HDMI optional.
  2. Connect power.
  3. Find the board in the router’s device list.
  4. ssh root@<ip>, password 1234. Armbian asks for a new root password, the shell (bash), a user (<user>) and its password, the time zone and the locale.
  5. No IP in the router after 3 minutes: connect HDMI and a keyboard to see where it stopped.
  1. lsblk: the eMMC is the mmcblkX disk that has mmcblkXboot0 and mmcblkXboot1; the microSD does not.
  2. sudo armbian-install, option for boot and system on the eMMC (exact wording to be confirmed), ext4.
  3. sudo poweroff, remove the microSD, power on again.
  4. Keep the microSD with Armbian for recovery.
Terminal window
uname -r
cat /sys/class/thermal/thermal_zone0/temp
lsusb -t
ip -br link
sudo ethtool <ethernet-interface> | grep Speed
free -h
swapon --show
  • Kernel 6.18 with current-rockchip64 in the name.
  • SSD at 5000M in lsusb -t. Lower: check that it is on the lower USB 3.0 port and check the cable.
  • Ethernet at 1000Mb/s. Lower: replace the patch cord.
  • /dev/zram0 in swapon --show.
  • 24 hours without unexpected reboots: journalctl --list-boots shows a single boot.
Terminal window
sudo hostnamectl set-hostname rock-01
sudo timedatectl set-timezone America/Recife
sudo apt update && sudo apt full-upgrade -y
sudo apt install -y ufw unattended-upgrades smartmontools restic gpiod curl git python3-venv
sudo rfkill block wlan
sudo rfkill block bluetooth
  1. Replace the old hostname with rock-01 in /etc/hosts.
  2. Reserve <rock-01-ip> in the router for the Ethernet MAC address (ip -br link).
  3. Journal size limit: install deploy/journald/10-size.conf in /etc/systemd/journald.conf.d/ and run sudo systemctl restart systemd-journald.
  4. Automatic security updates:
Terminal window
sudo dpkg-reconfigure -plow unattended-upgrades
  1. From your computer: ssh-copy-id <user>@<rock-01-ip>.
  2. Install deploy/ssh/10-hardening.conf in /etc/ssh/sshd_config.d/.
  3. sudo systemctl restart ssh and test a new login before closing the open session.
Terminal window
sudo ./deploy/firewall/ufw.sh <lan-subnet>

The script allows SSH (22) and charmlab-status (8080) from the LAN only and denies every other inbound connection. Do not open ports on the router.

  1. Make sure nothing on the SSD needs to be kept. The steps below erase it.
  2. Identify the SSD:
Terminal window
lsblk -o NAME,SIZE,MODEL,TRAN
  1. Format it (replace sda with the name shown):
Terminal window
sudo wipefs -a /dev/sda
sudo parted -s /dev/sda mklabel gpt mkpart data ext4 0% 100%
sudo mkfs.ext4 -L data /dev/sda1
sudo blkid /dev/sda1
  1. Line in /etc/fstab, with the UUID from blkid:
UUID=<uuid> /srv ext4 defaults,noatime,nofail,x-systemd.device-timeout=30 0 2
  1. Mount it and create the directories:
Terminal window
sudo systemctl daemon-reload
sudo mount -a
sudo mkdir -p /srv/docker /srv/stacks
  1. TRIM: lsblk --discard /dev/sda. If DISC-MAX is not 0: sudo systemctl enable --now fstrim.timer.
  2. SMART: sudo smartctl -d sat -a /dev/sda and sudo systemctl enable --now smartmontools.
  3. USB errors: sudo dmesg | grep -i -E "uas|reset". With repeated resets, take the enclosure ID from lsusb, add usbstoragequirks=<vid>:<pid>:u to /boot/armbianEnv.txt and reboot.
Keeps working Stops
System, SSH, Tailscale, cloudflared, charmlab-status, round display, status panel and alerts Docker and everything in it. Public addresses go down
  • charmlab-status raises the alert within 10 seconds (Alerts).
  • The node boots without the SSD (nofail); Docker does not start without /srv.
  • Bringing it back: reconnect the cable and run sudo reboot over SSH (LAN or Tailscale) or through the rescue dongle (Recovery). With no access at all: power cycle the board (Recovery).
  • After it is back: sudo dmesg | grep -i ext4 and docker ps.
  • File system errors after it is back: sudo systemctl stop docker, sudo umount /srv, sudo e2fsck -f /dev/sda1, sudo mount /srv, sudo systemctl start docker.
  • Test during installation, before there is any data: unplug the SSD with everything running, check the alert on the panel, Telegram, email and WhatsApp, and bring it back.
  1. Install from Docker’s official repository for Debian:
Terminal window
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
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
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
  1. Install deploy/docker/daemon.json in /etc/docker/.
  2. Install deploy/docker/docker.service.d/10-srv.conf in /etc/systemd/system/docker.service.d/.
  3. Apply and check:
Terminal window
sudo systemctl daemon-reload
sudo systemctl restart docker
docker info | grep "Docker Root Dir"
sudo usermod -aG docker <user>
  1. Log out and back in.

Rules for every Docker service are in deploy/stacks/README.md.

Tailscale:

Terminal window
CODENAME=$(. /etc/os-release && echo "$VERSION_CODENAME")
curl -fsSL "https://pkgs.tailscale.com/stable/debian/$CODENAME.noarmor.gpg" | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
curl -fsSL "https://pkgs.tailscale.com/stable/debian/$CODENAME.tailscale-keyring.list" | sudo tee /etc/apt/sources.list.d/tailscale.list
sudo apt update
sudo apt install -y tailscale
sudo tailscale up
sudo ufw allow in on tailscale0
  1. In the Tailscale admin console, disable key expiry for rock-01.
  2. From outside the home, SSH and admin pages only through Tailscale.

Cloudflare Tunnel, when a service is exposed:

  1. Install cloudflared from Cloudflare’s Debian repository.
  2. Create the tunnel in the Cloudflare dashboard (Zero Trust, Networks, Tunnels) and install it with sudo cloudflared service install <token>.
  3. Each hostname points to http://127.0.0.1:<port> of its service.
  4. The tunnel goes out through the Ethernet connection. No open port on the router and no Wi-Fi.
  5. Health address of the node: see Alerts.