Setup
System
Section titled “System”| 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
currentkernel. Do not useedge,vendor, rolling releases or the Radxa image. - No desktop. Keyboard and HDMI are only for the local console.
0. Existing system on the eMMC
Section titled “0. Existing system on the eMMC”The RK3399 boot ROM tries the eMMC before the microSD. With a system on the eMMC, the board ignores the microSD.
- Log in to the current system and find the eMMC (type
MMC):
lsblk -o NAME,SIZE,TYPE,MOUNTPOINTcat /sys/block/mmcblk*/device/type- Copy anything worth keeping (
/etc, home directories, package list) to another computer. - Flash the microSD (step 1).
- Wipe the start of the eMMC. This destroys the current system:
sudo dd if=/dev/zero of=/dev/mmcblkX bs=1M count=32 conv=fsyncsudo poweroff1. Flash the microSD
Section titled “1. Flash the microSD”- Download the Debian 13 Minimal image from the board page and check the SHA shown there.
- Write it to the microSD with Armbian Imager.
2. First boot from the microSD
Section titled “2. First boot from the microSD”- Board powered off: microSD in the slot, Ethernet to the switch or router, keyboard receiver on the upper USB 2.0 port. HDMI optional.
- Connect power.
- Find the board in the router’s device list.
ssh root@<ip>, password1234. Armbian asks for a new root password, the shell (bash), a user (<user>) and its password, the time zone and the locale.- No IP in the router after 3 minutes: connect HDMI and a keyboard to see where it stopped.
3. Install to the eMMC
Section titled “3. Install to the eMMC”lsblk: the eMMC is themmcblkXdisk that hasmmcblkXboot0andmmcblkXboot1; the microSD does not.sudo armbian-install, option for boot and system on the eMMC (exact wording to be confirmed), ext4.sudo poweroff, remove the microSD, power on again.- Keep the microSD with Armbian for recovery.
4. Check the hardware
Section titled “4. Check the hardware”uname -rcat /sys/class/thermal/thermal_zone0/templsusb -tip -br linksudo ethtool <ethernet-interface> | grep Speedfree -hswapon --show- Kernel 6.18 with
current-rockchip64in the name. - SSD at
5000Minlsusb -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/zram0inswapon --show.- 24 hours without unexpected reboots:
journalctl --list-bootsshows a single boot.
5. Base system
Section titled “5. Base system”sudo hostnamectl set-hostname rock-01sudo timedatectl set-timezone America/Recifesudo apt update && sudo apt full-upgrade -ysudo apt install -y ufw unattended-upgrades smartmontools restic gpiod curl git python3-venvsudo rfkill block wlansudo rfkill block bluetooth- Replace the old hostname with
rock-01in/etc/hosts. - Reserve
<rock-01-ip>in the router for the Ethernet MAC address (ip -br link). - Journal size limit: install deploy/journald/10-size.conf in
/etc/systemd/journald.conf.d/and runsudo systemctl restart systemd-journald. - Automatic security updates:
sudo dpkg-reconfigure -plow unattended-upgrades6. SSH
Section titled “6. SSH”- From your computer:
ssh-copy-id <user>@<rock-01-ip>. - Install deploy/ssh/10-hardening.conf in
/etc/ssh/sshd_config.d/. sudo systemctl restart sshand test a new login before closing the open session.
7. Firewall
Section titled “7. Firewall”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.
8. SSD on /srv
Section titled “8. SSD on /srv”- Make sure nothing on the SSD needs to be kept. The steps below erase it.
- Identify the SSD:
lsblk -o NAME,SIZE,MODEL,TRAN- Format it (replace
sdawith the name shown):
sudo wipefs -a /dev/sdasudo parted -s /dev/sda mklabel gpt mkpart data ext4 0% 100%sudo mkfs.ext4 -L data /dev/sda1sudo blkid /dev/sda1- Line in
/etc/fstab, with the UUID fromblkid:
UUID=<uuid> /srv ext4 defaults,noatime,nofail,x-systemd.device-timeout=30 0 2- Mount it and create the directories:
sudo systemctl daemon-reloadsudo mount -asudo mkdir -p /srv/docker /srv/stacks- TRIM:
lsblk --discard /dev/sda. IfDISC-MAXis not 0:sudo systemctl enable --now fstrim.timer. - SMART:
sudo smartctl -d sat -a /dev/sdaandsudo systemctl enable --now smartmontools. - USB errors:
sudo dmesg | grep -i -E "uas|reset". With repeated resets, take the enclosureIDfromlsusb, addusbstoragequirks=<vid>:<pid>:uto/boot/armbianEnv.txtand reboot.
If the SSD disconnects
Section titled “If the SSD disconnects”| 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-statusraises 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 rebootover 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 ext4anddocker 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.
9. Docker
Section titled “9. Docker”- Install from Docker’s official repository for Debian:
sudo install -m 0755 -d /etc/apt/keyringssudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.ascsudo chmod a+r /etc/apt/keyrings/docker.ascecho "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.listsudo apt updatesudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin- Install deploy/docker/daemon.json in
/etc/docker/. - Install deploy/docker/docker.service.d/10-srv.conf in
/etc/systemd/system/docker.service.d/. - Apply and check:
sudo systemctl daemon-reloadsudo systemctl restart dockerdocker info | grep "Docker Root Dir"sudo usermod -aG docker <user>- Log out and back in.
Rules for every Docker service are in deploy/stacks/README.md.
10. Remote access
Section titled “10. Remote access”Tailscale:
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/nullcurl -fsSL "https://pkgs.tailscale.com/stable/debian/$CODENAME.tailscale-keyring.list" | sudo tee /etc/apt/sources.list.d/tailscale.listsudo apt updatesudo apt install -y tailscalesudo tailscale upsudo ufw allow in on tailscale0- In the Tailscale admin console, disable key expiry for
rock-01. - From outside the home, SSH and admin pages only through Tailscale.
Cloudflare Tunnel, when a service is exposed:
- Install
cloudflaredfrom Cloudflare’s Debian repository. - Create the tunnel in the Cloudflare dashboard (Zero Trust, Networks, Tunnels) and install it with
sudo cloudflared service install <token>. - Each hostname points to
http://127.0.0.1:<port>of its service. - The tunnel goes out through the Ethernet connection. No open port on the router and no Wi-Fi.
- Health address of the node: see Alerts.