{"id":620,"date":"2026-03-21T22:52:57","date_gmt":"2026-03-21T14:52:57","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/install-raspberry-pi\/"},"modified":"2026-03-21T23:23:48","modified_gmt":"2026-03-21T15:23:48","slug":"install-raspberry-pi","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/install-raspberry-pi\/","title":{"rendered":"Raspberry Pi"},"content":{"rendered":"<h1>Raspberry Pi<\/h1>\n<p>Run a persistent, always-on OpenClaw Gateway on a Raspberry Pi. Since the Pi is just the gateway (models run in the cloud via API), even a modest Pi handles the workload well.<\/p>\n<h2>Prerequisites<\/h2>\n<ul>\n<li>Raspberry Pi 4 or 5 with 2 GB+ RAM (4 GB recommended)<\/li>\n<li>MicroSD card (16 GB+) or USB SSD (better performance)<\/li>\n<li>Official Pi power supply<\/li>\n<li>Network connection (Ethernet or WiFi)<\/li>\n<li>64-bit Raspberry Pi OS (required &#8212; do not use 32-bit)<\/li>\n<li>About 30 minutes<\/li>\n<\/ul>\n<h2>&#23433;&#35013;&#37197;&#32622;<\/h2>\n<p>    Use <strong>Raspberry Pi OS Lite (64-bit)<\/strong> &#8212; no desktop needed for a headless server.<\/p>\n<pre><code>1. Download [Raspberry Pi Imager](https:\/\/www.raspberrypi.com\/software\/).\n2. Choose OS: **Raspberry Pi OS Lite (64-bit)**.\n3. In the settings dialog, pre-configure:\n   * Hostname: `gateway-host`\n   * Enable SSH\n   * Set username and password\n   * Configure WiFi (if not using Ethernet)\n4. Flash to your SD card or USB drive, insert it, and boot the Pi.\n<\/code><\/pre>\n<\/p>\n<p>\n    <code>bash  theme={\"theme\":{\"light\":\"min-light\",\"dark\":\"min-dark\"}}<br \/>\n    ssh user@gateway-host<\/code>\n  <\/p>\n<p>\n    &#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\n    sudo apt update &amp;&amp; sudo apt upgrade -y<br \/>\n    sudo apt install -y git curl build-essential<\/p>\n<pre><code># Set timezone (important for cron and reminders)\nsudo timedatectl set-timezone America\/Chicago\n```\n<\/code><\/pre>\n<\/p>\n<p>\n    <code>bash  theme={\"theme\":{\"light\":\"min-light\",\"dark\":\"min-dark\"}}<br \/>\n    curl -fsSL https:\/\/deb.nodesource.com\/setup_24.x | sudo -E bash -<br \/>\n    sudo apt install -y nodejs<br \/>\n    node --version<\/code>\n  <\/p>\n<p>\n    &#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\n    sudo fallocate -l 2G \/swapfile<br \/>\n    sudo chmod 600 \/swapfile<br \/>\n    sudo mkswap \/swapfile<br \/>\n    sudo swapon \/swapfile<br \/>\n    echo &#8216;\/swapfile none swap sw 0 0&#8217; | sudo tee -a \/etc\/fstab<\/p>\n<pre><code># Reduce swappiness for low-RAM devices\necho 'vm.swappiness=10' | sudo tee -a \/etc\/sysctl.conf\nsudo sysctl -p\n```\n<\/code><\/pre>\n<\/p>\n<p>\n    <code>bash  theme={\"theme\":{\"light\":\"min-light\",\"dark\":\"min-dark\"}}<br \/>\n    curl -fsSL https:\/\/openclaw.ai\/install.sh | bash<\/code>\n  <\/p>\n<p>\n    <code>bash  theme={\"theme\":{\"light\":\"min-light\",\"dark\":\"min-dark\"}}<br \/>\n    openclaw onboard --install-daemon<\/code><\/p>\n<pre><code>Follow the wizard. API keys are recommended over OAuth for headless devices. Telegram is the easiest channel to start with.\n<\/code><\/pre>\n<\/p>\n<p>\n    <code>bash  theme={\"theme\":{\"light\":\"min-light\",\"dark\":\"min-dark\"}}<br \/>\n    openclaw status<br \/>\n    sudo systemctl status openclaw<br \/>\n    journalctl -u openclaw -f<\/code>\n  <\/p>\n<p>\n    On your computer, get a dashboard URL from the Pi:<\/p>\n<pre><code>```bash  theme={\"theme\":{\"light\":\"min-light\",\"dark\":\"min-dark\"}}\nssh user@gateway-host 'openclaw dashboard --no-open'\n```\n\nThen create an SSH tunnel in another terminal:\n\n```bash  theme={\"theme\":{\"light\":\"min-light\",\"dark\":\"min-dark\"}}\nssh -N -L 18789:127.0.0.1:18789 user@gateway-host\n```\n\nOpen the printed URL in your local browser. For always-on remote access, see [Tailscale integration](\/gateway\/tailscale).\n<\/code><\/pre>\n<\/p>\n<h2>Performance tips<\/h2>\n<p><strong>Use a USB SSD<\/strong> &#8212; SD cards are slow and wear out. A USB SSD dramatically improves performance. See the <a href=\"https:\/\/www.raspberrypi.com\/documentation\/computers\/raspberry-pi.html#usb-mass-storage-boot\">Pi USB boot guide<\/a>.<\/p>\n<p><strong>Enable module compile cache<\/strong> &#8212; Speeds up repeated CLI invocations on lower-power Pi hosts:<\/p>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\ngrep -q &#8216;NODE_COMPILE_CACHE=\/var\/tmp\/openclaw-compile-cache&#8217; ~\/.bashrc || cat &gt;&gt; ~\/.bashrc &lt;&lt;&#8216;EOF&#8217; # pragma: allowlist secret<br \/>\nexport NODE_COMPILE_CACHE=\/var\/tmp\/openclaw-compile-cache<br \/>\nmkdir -p \/var\/tmp\/openclaw-compile-cache<br \/>\nexport OPENCLAW_NO_RESPAWN=1<br \/>\nEOF<br \/>\nsource ~\/.bashrc<\/p>\n<pre><code>\n**Reduce memory usage** -- For headless setups, free GPU memory and disable unused services:\n\n```bash  theme={\"theme\":{\"light\":\"min-light\",\"dark\":\"min-dark\"}}\necho 'gpu_mem=16' | sudo tee -a \/boot\/config.txt\nsudo systemctl disable bluetooth\n<\/code><\/pre>\n<h2>&#25925;&#38556;&#25490;&#26597;<\/h2>\n<p><strong>Out of memory<\/strong> &#8212; Verify swap is active with <code>free -h<\/code>. Disable unused services (<code>sudo systemctl disable cups bluetooth avahi-daemon<\/code>). Use API-based models only.<\/p>\n<p><strong>Slow performance<\/strong> &#8212; Use a USB SSD instead of an SD card. Check for CPU throttling with <code>vcgencmd get_throttled<\/code> (should return <code>0x0<\/code>).<\/p>\n<p><strong>Service will not start<\/strong> &#8212; Check logs with <code>journalctl -u openclaw --no-pager -n 100<\/code> and run <code>openclaw doctor --non-interactive<\/code>.<\/p>\n<p><strong>ARM binary issues<\/strong> &#8212; If a skill fails with &#8220;exec format error&#8221;, check whether the binary has an ARM64 build. Verify architecture with <code>uname -m<\/code> (should show <code>aarch64<\/code>).<\/p>\n<p><strong>WiFi drops<\/strong> &#8212; Disable WiFi power management: <code>sudo iwconfig wlan0 power off<\/code>.<\/p>\n<h2>&#19979;&#19968;&#27493;<\/h2>\n<ul>\n<li><a href=\"\/channels\">Channels<\/a> &#8212; connect Telegram, WhatsApp, Discord, and more<\/li>\n<li><a href=\"\/gateway\/configuration\">Gateway configuration<\/a> &#8212; all config options<\/li>\n<li><a href=\"\/install\/updating\">Updating<\/a> &#8212; keep OpenClaw up to date<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Raspberry Pi Run a persistent, always-on OpenClaw Gatew [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-620","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/620","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=620"}],"version-history":[{"count":3,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/620\/revisions"}],"predecessor-version":[{"id":774,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/620\/revisions\/774"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=620"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=620"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}