Skip to content

The Deska blog

Running AI Coding Agents Against Your Homelab From a Raspberry Pi

Learn how to host AI coding agents on a Raspberry Pi and access them via Deska secure relay for an always-on remote homelab development environment.

10 min read

Developing on a homelab offers a level of control and privacy that cloud environments cannot match. When you transition to using modern developer tools, the goal is often to maintain that sovereignty while gaining the speed of automated workflows. Running AI coding agents against your homelab from a Raspberry Pi transforms a simple credit card sized computer into a persistent, intelligent orchestrator for your entire network. By hosting an agent like Claude Code or Codex CLI on a low power, always on device, you create a bridge between your local hardware and your creative process.

The Case for Always On Agent Hosts

Traditional development involves opening a laptop, starting a session, and closing it when finished. AI agents change this dynamic. An agent performing complex refactoring or system monitoring needs time and persistence. A Raspberry Pi is the ideal candidate for this role because it consumes minimal electricity and operates silently in the corner of your lab.

When an agent runs on your Pi, it has direct access to your local network services. It can interact with your Home Assistant instance, manage your Docker containers, or refactor scripts living on your NAS. Because the Pi is always on, the agent state remains active even when your primary workstation is asleep. This setup moves the "brain" of your operations to the edge of your network.

Hardware and OS Considerations

For running modern AI coding agents, a Raspberry Pi 4 or 5 with at least 8GB of RAM is recommended. While the agents themselves do not usually run the large language models locally, they do maintain large context windows and perform significant file system operations.

  1. Use a high speed NVMe SSD via a PCIe hat or a high endurance SD card to prevent disk I/O bottlenecks during repository indexing.
  2. Install a 64 bit version of Raspberry Pi OS or Ubuntu Server to ensure compatibility with Node.js and Python environments required by most agents.
  3. Ensure your cooling solution is active. Heavy terminal operations and recursive file searches can spike CPU usage.

Once your OS is ready, you can install tools like Claude Code via npm. These tools act as a bridge. They take your high level instructions and execute terminal commands or file edits directly on the Pi or any networked machine it can reach via SSH.

Accessing the Lab Remotely with Deska

The primary challenge of a Raspberry Pi homelab is accessibility. Exposing your Pi to the open internet via port forwarding is a significant security risk. This is where Deska provides a secure alternative.

Deska functions as a desktop workspace that connects to your devices through a secure relay. Because Deska is local-first, your code and sessions stay on your machines. When you run Deska on your Raspberry Pi and your laptop, the two devices pair directly. This allows you to open a terminal panel on your laptop that is actually running on the Pi, without exposing any ports to the public web.

The mobile app further extends this utility. If you are away from your desk, you can check the progress of an agent session from your phone. The secure relay ensures that the connection is encrypted and direct, keeping your homelab private while remaining accessible from anywhere.

Managing Multiple Agents in One Workspace

A complex homelab environment often requires different tools for different tasks. You might use Claude Code for high level architectural changes and a specialized CLI for infrastructure as code. Deska allows you to run these agents side by side.

The infinite canvas in Deska lets you arrange your workspace strategically. You can have a terminal panel running an agent on the left, a Monaco code editor in the center, and a documentation browser on the right. This layout is persistent. When you reconnect to your Pi from another device, your panels remain exactly where you left them.

Comparing Agent Interfaces

FeatureCLI OnlyCloud IDEDeska Workspace
PersistenceHigh (with screen/tmux)MediumHigh (native sessions)
LayoutLinearTabbedInfinite Canvas
Remote AccessSSH/VPNBrowser LoginSecure Peer Relay
PrivacyHighLowHigh

While standard SSH is sufficient for basic tasks, it lacks the visual context needed for complex AI interactions. Using terminals within a spatial canvas allows you to see the output of multiple commands and the state of your files simultaneously.

Automating Lab Maintenance

With an agent running on your Pi, you can delegate routine maintenance. You can prompt the agent to check for container updates, verify backup integrity, or even write new automation scripts for your smart home.

The Ask Deska assistant can help drive this workspace. You can use voice commands to open new panels or check on the status of your running agents. If you are multitasking, being able to say a command to bring up a specific log file or terminal session on your Pi saves significant cognitive overhead.

Security Best Practices

When running AI agents with write access to your homelab, security is paramount. Since you are using remote access through a relay, you avoid the risks of open ports, but you must still manage your API keys carefully.

Deska supports a BYOK (Bring Your Own Key) model. This means your sensitive credentials for AI providers are stored locally on your device, not on a third party server. Additionally, because the environment is local-first, the actual content of your files never leaves your network unless it is sent to the specific AI provider you have authorized.

  • Use a dedicated user account on the Raspberry Pi for the AI agent.
  • Limit the agent's directory access using standard Linux permissions.
  • Regularly audit the shell history to see what commands the agent has executed.

FAQ

How do I run Claude Code on Raspberry Pi?

To run Claude Code, ensure you have Node.js installed on your Raspberry Pi. Use the command npm i -g @anthropic-ai/claude-code to install the agent globally. Once installed, you can launch it inside a Deska terminal panel to start interacting with your local files through the secure relay.

Can I access my homelab agents without a VPN?

Yes, you can use the Deska secure relay to access your homelab. Unlike a traditional VPN that requires complex configuration and often open ports, Deska pairs your devices directly. This allows you to monitor and control your coding agents from a laptop or phone using an encrypted tunnel that works behind most firewalls.

Is the Raspberry Pi powerful enough for AI agents?

While a Raspberry Pi cannot easily host the massive models used by Claude or GPT-4, it is more than capable of running the agentic software that communicates with these models. The Pi handles the file system operations, terminal commands, and network requests, while the heavy inference is done via API. This makes it an efficient and cost effective "head" for your AI driven homelab.

Getting Started with Your AI Lab

Building a persistent AI development environment on a Raspberry Pi provides a robust foundation for any developer. It combines the low cost and high uptime of edge computing with the advanced capabilities of modern AI agents. By using a workspace that supports canvas layouts and secure remote connectivity, you remove the friction between your ideas and your hardware.

To start building your own remote AI workspace and manage your homelab agents from anywhere, download Deska for free.