Home Tutorials Categories Skills About
ZH EN JA KO
Installation

Deploying OpenClaw on Synology NAS

· 17 min read

Introduction

A Synology NAS serves as the data hub for many homes and small businesses. By leveraging its Docker capabilities to deploy OpenClaw, you can have a 24/7 online AI assistant service. This article provides a detailed guide on deploying OpenClaw through Synology's Container Manager (formerly known as the Docker package).

Prerequisites

Requirement Description
NAS Model x86-based Synology models with Docker support (e.g., DS220+, DS920+, DS1621+, etc.)
DSM Version DSM 7.2 or higher
Memory At least 4GB (8GB+ recommended)
Storage At least 2GB of available space
Package Container Manager installed

Note: Entry-level Synology models with ARM architecture (e.g., DS120j, DS220j) do not support Docker and cannot use the method described in this tutorial.

Step 1: Install Container Manager

If you haven't installed the Container Manager package yet:

  1. Open DSM and go to "Package Center"
  2. Search for "Container Manager"
  3. Click "Install"
  4. Wait for the installation to complete

Step 2: Download the OpenClaw Image

Method A: Via the Container Manager Interface

  1. Open Container Manager
  2. Click "Registry" in the left panel
  3. Search for openclaw/openclaw in the search box
  4. Select the official image and click "Download"
  5. Choose the latest tag and confirm the download

Method B: Via SSH Command Line

First, enable SSH in DSM: Control Panel > Terminal & SNMP > Enable SSH service.

# SSH into the Synology
ssh admin@YOUR_NAS_ADDRESS

# Pull the image with sudo
sudo docker pull openclaw/openclaw:latest

Step 3: Prepare the Configuration Directory

Create directories on the Synology to store OpenClaw configuration and data.

Via File Station

  1. Open File Station
  2. Navigate to the docker shared folder (create one in Storage Manager if it doesn't exist)
  3. Create a folder named openclaw
  4. Inside openclaw, create two subfolders: config and data

Final directory structure:

/docker/openclaw/
├── config/
└── data/

Via SSH

sudo mkdir -p /volume1/docker/openclaw/config
sudo mkdir -p /volume1/docker/openclaw/data
sudo chown -R 1000:1000 /volume1/docker/openclaw

Step 4: Create the Configuration File

Create the openclaw.json5 configuration file in the config directory. You can upload it via File Station or create it via SSH:

cat > /volume1/docker/openclaw/config/openclaw.json5 << 'EOF'
{
  // OpenClaw configuration file
  // See the configuration guide for detailed options

  gateway: {
    port: 18789,
    host: "0.0.0.0",
  },

  models: {
    default: "claude",
    providers: {
      claude: {
        apiKey: "sk-ant-your-api-key-here",
        model: "claude-sonnet-4-20250514",
      },
    },
  },

  channels: {
    // Configure messaging channels as needed
  },

  logging: {
    level: "info",
    file: "/app/data/openclaw.log",
  },
}
EOF

Replace sk-ant-your-api-key-here with your actual API key.

Step 5: Create the Container

Method A: Via the Container Manager Interface

  1. Open Container Manager, click "Container" > "Create"
  2. Select the openclaw/openclaw:latest image
  3. Set the container name to openclaw
  4. Check "Enable auto-restart"

Port Settings:

Local Port Container Port Protocol
18789 18789 TCP

Volume Mappings:

Local Path Container Path Permissions
/volume1/docker/openclaw/config /app/config Read/Write
/volume1/docker/openclaw/data /app/data Read/Write

Environment Variables:

Variable Value
OPENCLAW_CONFIG /app/config/openclaw.json5
TZ Asia/Shanghai
NODE_ENV production
  1. Click "Next", review the settings, then click "Done"

Method B: Via docker-compose (Recommended)

Create a docker-compose.yml file in the /volume1/docker/openclaw/ directory:

version: "3.8"

services:
  openclaw:
    image: openclaw/openclaw:latest
    container_name: openclaw
    restart: always
    ports:
      - "18789:18789"
    volumes:
      - ./config:/app/config
      - ./data:/app/data
    environment:
      - OPENCLAW_CONFIG=/app/config/openclaw.json5
      - TZ=Asia/Shanghai
      - NODE_ENV=production
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:18789/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 30s
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"

Start via SSH:

cd /volume1/docker/openclaw
sudo docker-compose up -d

Step 6: Verify the Deployment

Check Container Status

Check whether the container is running normally (green status) in Container Manager, or via the command line:

sudo docker ps | grep openclaw

View Logs

sudo docker logs -f openclaw

You should see output similar to:

[OpenClaw] Gateway started on port 18789
[OpenClaw] Model provider: Claude (claude-sonnet-4-20250514)
[OpenClaw] Channels: ready

Access the Dashboard

Open the following URL in your browser:

http://YOUR_NAS_ADDRESS:18789/dashboard

Step 7: Configure Synology Firewall

If your Synology has the firewall enabled, you need to allow port 18789:

  1. Open DSM Control Panel
  2. Go to "Security" > "Firewall"
  3. Click "Edit Rules"
  4. Create a new rule:
    • Port: Custom, enter 18789
    • Protocol: TCP
    • Action: Allow
  5. Save and apply

Step 8: Configure Reverse Proxy (Optional)

Synology has a built-in reverse proxy feature that lets you access OpenClaw via a domain name.

  1. Open DSM Control Panel
  2. Go to "Login Portal" > "Advanced" > "Reverse Proxy"
  3. Create a new rule:
    • Description: OpenClaw
    • Source protocol: HTTPS
    • Source hostname: openclaw.yourdomain.com
    • Source port: 443
    • Destination protocol: HTTP
    • Destination hostname: localhost
    • Destination port: 18789

Combined with Synology's DDNS and Let's Encrypt certificates, you can achieve secure external access.

Auto-Restart Policy

Setting Up in Container Manager

Simply enable "Enable auto-restart" in the container settings. The container will automatically start after the NAS reboots.

Health Checks

If you're using the healthcheck configuration in docker-compose, Docker will periodically check OpenClaw's health status. When an unhealthy state is detected, the container is automatically restarted.

Check health status:

sudo docker inspect --format='{{.State.Health.Status}}' openclaw

Data Backup

Use Synology's Hyper Backup to back up OpenClaw's configuration and data:

  1. Open Hyper Backup
  2. Create a new backup task
  3. Select the backup destination
  4. In the folder selection, check /docker/openclaw/
  5. Set up a scheduled backup (daily recommended)

Manual backup is also straightforward:

# Create a backup
sudo tar -czf /volume1/backups/openclaw-backup-$(date +%Y%m%d).tar.gz \
  /volume1/docker/openclaw/config \
  /volume1/docker/openclaw/data

Common Issues

Issue Solution
Container won't start Check if the port is in use: sudo netstat -tlnp | grep 18789
Configuration file not taking effect Verify volume mapping paths and file permissions
Cannot access from outside Check router port forwarding and Synology firewall settings
Image pull failed Try configuring a Docker mirror accelerator
Container out of memory Increase the memory limit in container settings

Configure Docker Mirror Acceleration

If image pulling is slow, you can configure a mirror accelerator. Edit the Docker configuration via SSH:

sudo tee /etc/docker/daemon.json > /dev/null << 'EOF'
{
  "registry-mirrors": [
    "https://mirror.ccs.tencentyun.com"
  ]
}
EOF

sudo systemctl restart docker

Summary

Deploying OpenClaw via Docker on a Synology NAS gives you a stable, low-power, 24/7 AI assistant service. Synology's built-in storage management, backup, and reverse proxy features make operations remarkably simple. We recommend using Hyper Backup for regular configuration data backups to ensure data safety.

OpenClaw is a free, open-source personal AI assistant that supports WhatsApp, Telegram, Discord, and many more platforms