## Introduction: Why Move OpenClaw to a Home Lab?
As a personal assistant, my OpenClaw instance is a part of my daily workflow. Initially, it ran on my desktop PC, which was convenient for initial setup and testing. However, I quickly realized a limitation: my desktop doesn’t run 24/7. To save power, I typically shut it down at night, which meant my OpenClaw assistant went offline with it.
My home server, which runs TrueNAS Scale, on the other hand, runs continuously. This makes it the ideal candidate for hosting services that I need available around the clock, like OpenClaw. The goal was simple: move OpenClaw from my desktop to my home server to ensure uninterrupted access and reliability.
## My OpenClaw Setup
Before diving into the migration, a quick overview of my OpenClaw setup. I primarily use it as a personal assistant. Its primary interface for me is Slack, allowing seamless interaction from any device where I have Slack installed.
## Options for Running OpenClaw on TrueNAS Scale
When considering how to host OpenClaw on TrueNAS Scale, two main options came to mind:
-
App/Docker Container: TrueNAS Scale has excellent support for Docker containers via its “Apps” feature.
- Pros: Lightweight, easy to deploy and manage, leverages existing container infrastructure.
- Cons: Might be more complex for custom networking or specific OpenClaw dependencies that aren’t easily contained. Configuration management within a container might also require more thought.
-
Virtual Machine (VM): Running a full-fledged operating system in a VM.
- Pros: Provides a completely isolated environment, familiar setup process (like installing on a regular server), full control over the OS and network stack.
- Cons: More resource-intensive than a container, requires managing a separate OS.
I opted for the Virtual Machine approach. While slightly heavier on resources, it offered the greatest flexibility and control, which I felt was important for a complex application like OpenClaw that interacts with many parts of my digital life.
## Setting Up the Virtual Machine
The first step was to prepare the virtual machine on my TrueNAS Scale host. TrueNAS makes this easy to do from the admin UI.
-
Create the VM: When setting up the network I attached it to the same interface the NAS uses for communication on my home network. This allows the VM to get it’s own IP on the network so I can ssh into it from my desktop. One side effect of this however is that it can’t route to the TrueNAS host without a separate bridge interface.
-
Install OS (Debian): I created a new VM and installed a minimal Debian instance. Debian is a stable and lightweight choice, and I already had an ISO downloaded.
-
Setting Up a Network Bridge: To allow the VM to communicate directly with services on the host, I configured a network bridge on the TrueNAS host.
- In the network configuration I created a new interface with the type “Bridge” and named it
br0 - Importantly, I didn’t add any other network interfaces as bridge members. Because I want this to just be for communication between the VM and the host
- Under aliases, I added the IP address
10.0.0.1/24. This sets the IP of the host and the subnet mask for the network.
- In the network configuration I created a new interface with the type “Bridge” and named it
-
Adding the Bridge to the VM: From the host I added a new NIC device to the VM, configured to attach to
br0. -
Network Configuration: Inside the VM, I reconfigured the networking so that the interface attached to the bridge used a static IP (
10.0.0.2), and the interface attached to my home network used DHCP. -
Install Dependencies: Once the network was solid, I installed all the necessary dependencies for OpenClaw (Node.js, Python, git, etc.) within the Debian VM.
-
Install OpenClaw: Finally, I installed OpenClaw with
npm i -g openclaw.
