Skip to content

About

Run OpenClaw on any Docker-capable NAS with LAN-only access, Nginx proxy, and optional local HTTPS.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

7 stars

Watchers

0 watching

Forks

Repository files navigation

OpenClaw on NAS

English | Español

Docker-capable NAS Tested on Synology Docker Compose Nginx TLS proxy Local HTTPS with generated CA LAN-only access

Star this repository on GitHub

OpenClaw NAS Docker deployment

Run OpenClaw on a NAS with Docker, local HTTPS and LAN-only access. Do not port-forward OpenClaw from your router.

LAN browser -> https://<nas-ip>:8443 -> Nginx TLS proxy -> OpenClaw gateway (127.0.0.1:18789)

The NAS runs a pre-built image published by this repository. It never builds the image locally:

Registry Image
GitHub Container Registry (default) ghcr.io/luprintech/openclaw-nas-docker
Docker Hub (mirror) luprintechdev/openclaw-nas-docker

GitHub Actions builds the image from Dockerfile, tests it and publishes it; docker-compose.yml only pulls and runs it.

Tip

Is this project useful to you? ⭐ Star it on GitHub so other NAS users can find it. It takes one click and helps the project keep going.

Contents


Requirements

  • A NAS with an x86-64 (amd64) CPU. Images are published for linux/amd64 only, so ARM-based models cannot run them.
  • Docker with Docker Compose v2 (docker compose version must work). On Synology, install Container Manager from the Package Center.
  • SSH access to the NAS with a user that can run docker.
  • curl on the NAS to download the installer and later updates.
  • A stable LAN IP for the NAS (see step 0).

Tested on Synology DSM, including models with the Linux 4.4 kernel such as the DS220+. It should work on other x86-64 NAS systems that run Docker (QNAP, Ugreen, TerraMaster, Asustor, etc.).


Video tutorial

Watch the installation walkthrough on YouTube


First install, step by step

The examples use 192.168.1.50 as the NAS IP and /volume1/docker/openclaw as the install folder. Replace both with your own values.

Security rule: keep OpenClaw LAN-only. Do not port-forward 8443 or 18789 from your router.

0. Give your NAS a stable LAN IP

The installer stores the NAS IP in .env and uses it for the dashboard URL, the allowed browser origins and the HTTPS certificate. If the IP changes later, those stop matching and you must re-run the installer with the new IP.

Option Recommended? Tradeoff
DHCP reservation in your router Best option The router always gives the NAS the same IP. Low risk, easy to undo.
Static IP in the NAS control panel Good option No router changes, but a wrong gateway, DNS or subnet can disconnect the NAS.
Static IP over SSH Not recommended on Synology DSM manages networking and can overwrite low-level changes. Easy to lock yourself out.

Recommended: reserve the IP in your router

  1. Open your router admin page and find the NAS in the DHCP / LAN clients list.
  2. Copy its MAC address.
  3. Create a DHCP reservation (also called static lease or address reservation) for that MAC, for example 192.168.1.50.
  4. Reboot the NAS or renew its network lease.
  5. Confirm the NAS answers on that IP.

Synology DSM: set a manual IP from the UI

  1. In DSM, open Control Panel → Network → Network Interface.
  2. Select your active interface (usually LAN 1) and click Edit.
  3. In IPv4, choose manual configuration and set the IP (for example 192.168.1.50), subnet mask (usually 255.255.255.0), gateway (your router, for example 192.168.1.1) and DNS server.
  4. Apply and reconnect to DSM using the new IP.

A wrong gateway, subnet or IP range can cut your access to DSM until you fix it locally, so double-check the values. Use SSH only to check the current address (ip addr), not to set a permanent one.

1. Connect to the NAS and create the install folder

NAS Suggested path
Synology /volume1/docker/openclaw
QNAP /share/Container/openclaw
Others /opt/openclaw or any writable folder
ssh your-user@192.168.1.50
mkdir -p /volume1/docker/openclaw
cd /volume1/docker/openclaw

On Synology, enable SSH first in Control Panel → Terminal & SNMP.

2. Download and run the installer

curl -fsSL https://raw.githubusercontent.com/luprintech/openclaw-nas-docker/main/install.sh -o install.sh
chmod +x install.sh
./install.sh 192.168.1.50

Run it from the install folder and keep install.sh there: you will use it again if the IP or port changes.

The installer shows one line per step:

[1/5] Checking requirements... done (1s)
[2/5] Preparing files, configuration and HTTPS certificate... done (2s)
[3/5] Downloading OpenClaw (the first time can take several minutes)... done (3m10s)
[4/5] Starting OpenClaw... done (5s)
[5/5] Configuring access... done (50s)

✓ OpenClaw is installed and running.

Behind those steps it checks Docker and Docker Compose v2, creates .env with a random OPENCLAW_GATEWAY_TOKEN, your time zone and the NAS IP, writes docker-compose.yml, nginx/nginx.conf and the ./openclaw command, creates a local certificate authority and an HTTPS certificate with OpenSSL, gives config/ and workspace/ to UID/GID 1000 (the user that runs OpenClaw inside the container), starts the stack and applies the allowed origins and proxy settings. It never installs software on the NAS.

When it finishes it prints the dashboard URL, the certificate to install on your devices and the next steps. The full output is saved in logs/install-<date>.log; run OPENCLAW_VERBOSE=1 ./install.sh 192.168.1.50 to see it on screen instead.

3. Trust the local root certificate on each device

The installer created a private certificate authority for your LAN. Copy its root certificate from the NAS to every computer or phone that will open OpenClaw:

  • certs/rootCA.cer for Windows
  • certs/rootCA.pem for macOS, iPhone/iPad, Android and Linux

You can copy it with File Station (Synology) or scp. Then install it as a trusted root authority: see Installing rootCA on client devices.

If you skip this step the browser warns that the connection is not private. That is expected for a private LAN certificate.

4. Open the dashboard

Open the HTTPS URL in your browser:

https://192.168.1.50:8443

There is no plain-HTTP address. Port 18789 only listens on the NAS itself (127.0.0.1), so http://192.168.1.50:18789 will not work from your computer.

If the dashboard asks for the gateway token, show it on the NAS and paste only the value after =:

grep OPENCLAW_GATEWAY_TOKEN .env

5. Run onboarding and configure your AI provider

./openclaw onboard

Onboarding runs inside the container. Follow the prompts to choose your AI provider and enter its API key or sign in.

Add or change API keys from the browser. Once your browser is paired (step 6), open the dashboard and go to Settings → Models → Add account. Paste the API key or sign in with the provider. OpenClaw checks the key right away, and Test access checks it again later. Changing model settings needs admin access in the dashboard. Keys saved this way are stored in OpenClaw's credential store inside config/, so they survive updates and are included in the update backups. This is the easiest option for most users.

Or put provider keys in .env, which is handy for automation. The supported entries are ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY, OPENROUTER_API_KEY, MISTRAL_API_KEY, GROQ_API_KEY and COHERE_API_KEY. After editing .env, apply the change with:

./openclaw stop
./openclaw start

Only non-empty values are passed to OpenClaw, so an empty entry never hides a key stored in OpenClaw's own config/.env. The gateway, the Claude Code CLI and the ./openclaw commands see these keys; a raw docker compose exec does not. A non-empty ANTHROPIC_API_KEY makes Claude Code bill the API key instead of using your account login.

6. Pair your browser

Pairing authorizes your browser as a known device.

  1. Print the dashboard and pairing information:

    ./openclaw dashboard
  2. Open the printed URL in your browser, enter the gateway token if asked and start the pairing flow.

  3. Back in SSH, list pending devices:

    ./openclaw devices
  4. Copy the request_id of your browser and approve it:

    ./openclaw approve <request_id>
  5. Refresh the browser. It is now paired.

7. Check that everything works

./openclaw status
./openclaw doctor

status should show both containers as Up and the gateway as healthy. If something fails, look at the logs:

./openclaw logs openclaw-gateway
./openclaw logs nginx

Press Ctrl+C to stop following the logs.


Everyday commands

Run them from the install folder.

OpenClaw (the stack must be running):

Command What it does
./openclaw onboard Runs OpenClaw onboarding
./openclaw dashboard Prints the dashboard and pairing URL
./openclaw devices Lists known and pending devices
./openclaw approve <request_id> Approves a device pairing request
./openclaw doctor Runs OpenClaw diagnostics
./openclaw agent --message "hi" Talks to the assistant
./openclaw message send --target <target> --message "hi" Sends a message through a channel
./openclaw pip install <package> Installs a Python package for skills
./openclaw claude Opens the Claude Code CLI
./openclaw <anything else> Passes the command to the OpenClaw CLI, e.g. ./openclaw config get gateway.bind

Stack:

Command What it does
./openclaw start Creates and starts the containers (docker compose up -d). Applies changes to .env
./openclaw stop Stops and removes the containers (docker compose down). Your data in config/ and workspace/ is kept
./openclaw restart Restarts the existing containers. Does not apply .env changes: use stop + start for that
./openclaw status Shows container status
./openclaw logs [service] Follows the logs of all services or one (openclaw-gateway, nginx)
./openclaw shell Opens a shell in a temporary CLI container
./openclaw update Updates the stack files and the image, then migrates your data (see below)
./openclaw help Shows the command list

Updating OpenClaw

When a new stable version is available, any ./openclaw command tells you:

A new stable version of OpenClaw NAS Docker is available: 2026.11.7 (installed: 2026.11.6).
To install it, run: ./openclaw update

Once a day, in the background, the wrapper asks the GitHub API for the latest stable release. It is a plain read-only request, like opening the releases page in a browser, and sends nothing about your installation. The check never slows down or fails a command. To turn it off, add OPENCLAW_NO_UPDATE_CHECK=1 to .env. You can also click Watch → Custom → Releases on GitHub to get an email for every new version.

Always update with:

cd /volume1/docker/openclaw
./openclaw update

It shows one line per step and a summary:

[1/6] Downloading the latest version of this stack... done (1s)
[2/6] Downloading the OpenClaw image (can take a few minutes)... done (40s)
[3/6] Backing up your data... done (5s)
[4/6] Stopping OpenClaw... done (4s)
[5/6] Updating your data (can take several minutes)... done (2m30s)
[6/6] Starting OpenClaw... done (15s)

✓ OpenClaw is up to date and running.
  Version: OpenClaw 2026.11.6 (06afb10)
  Open:    https://192.168.1.50:8443
  Backup:  /volume1/docker/openclaw/openclaw-backup-20261120-111328
  Log:     logs/update-20261120-111325.log

What each step does:

  1. Downloads the latest install.sh, docker-compose.yml, openclaw and scripts/migrate-openclaw.sh from this repository (or runs git pull if the folder is a Git clone). The files are checked before they replace the current ones, so a failed download changes nothing.
  2. Pulls the configured image (:latest by default). If OpenClaw was stopped, it is started first, because the backup is taken from it.
  3. Backs up your OpenClaw data, .env, docker-compose.yml and nginx/ into a new openclaw-backup-<date>-<time> folder (see Backups and restoring).
  4. Stops the gateway, giving it up to 90 seconds to shut down cleanly.
  5. Repairs file ownership and runs the data migrations required by the new OpenClaw version (openclaw doctor --fix --non-interactive and the session import).
  6. Starts the gateway, waits until it is healthy and restarts Nginx.

The detailed output of every step goes to logs/update-<date>.log (the last ten are kept). Run ./openclaw update --verbose to see it on screen instead.

If OpenClaw doctor still has something for you to do, the summary lists it under OpenClaw doctor recommends. If a step reported a problem, the summary starts with finished with N warning(s) and lists them: wait a minute and run ./openclaw update again.

Do not update with docker compose pull and up -d alone. That skips the data migration: recent OpenClaw versions then start with a degraded agent database, Docker still reports the gateway as healthy and the Control UI does not load. If that already happened, run bash scripts/migrate-openclaw.sh upgrade.

If an update fails, it stops at that step and prints the last lines of its log, the full log path and the backup folder. Do not restart the gateway again and again; read the log and check:

docker compose ps
docker compose logs --since 5m --tail=120 openclaw-gateway

The updater never restores data on its own, and a failed update never deletes any backup, so you keep the evidence and decide what to do.

On Synology, the update log can contain EPERM: operation not permitted, fchmod from OpenClaw doctor. It is harmless when the update ends with ✓ OpenClaw is up to date and running and ./openclaw status shows the gateway as healthy.

Important

Installed before the Synology 2026.9.9 compatibility update? Refresh the ./openclaw wrapper once before your first update. It does not touch your configuration, workspace or sessions:

curl -fsSL https://raw.githubusercontent.com/luprintech/openclaw-nas-docker/main/install.sh -o install.sh
bash install.sh --wrapper-only
./openclaw update

Release channels

Every image is published under several tags:

Tag When it changes Use it if
latest (default) Only after the version has been tested on a real Synology NAS You want a stable NAS. install.sh and docker-compose.yml use it
edge As soon as a new OpenClaw version passes the automated tests You want new versions early and can recover from a broken update
<version> (e.g. 2026.11.6) Never; it always points to the same image You want to stay on an exact version

Version tags are immutable. If the image is rebuilt for the same OpenClaw version (for example after a fix in this repository), it is published with a suffix such as 2026.11.6-1 instead of replacing 2026.11.6.

Every image carries a signed build provenance attestation. To check that an image was built by this repository's workflow:

gh attestation verify oci://ghcr.io/luprintech/openclaw-nas-docker:latest \n  --repo luprintech/openclaw-nas-docker

How a new OpenClaw version reaches latest:

  1. Every six hours a workflow checks for a new stable OpenClaw release (prereleases are ignored).
  2. CI builds the image and runs scripts/smoke-test.sh: clean start, upgrade from the current latest on the same data, healthy gateway, no degraded agent database and a working claude CLI. If anything fails, nothing is published and an issue labelled openclaw-update-failed is opened.
  3. If the tests pass, a pull request pins the version on main and is merged automatically. The image is published as :<version> and :edge on GHCR and Docker Hub, with a GitHub prerelease and an issue labelled release-candidate that contains the NAS checklist.
  4. The maintainer tests that image on a Synology NAS. CI runners use a modern kernel and cannot reproduce problems specific to the Linux 4.4 kernel of some Synology models (for example the missing openat2 call).
  5. The maintainer runs the Promote to stable workflow. It copies that exact image to :latest on both registries without rebuilding it, marks the GitHub release as latest and closes the checklist issue. Running it with an older version rolls latest back.

After a promotion or a rollback, run ./openclaw update on your NAS to get it.

Following edge

  1. Edit .env and set:

    OPENCLAW_IMAGE=ghcr.io/luprintech/openclaw-nas-docker:edge
  2. Run ./openclaw update.

To go back to latest, leave the value empty (OPENCLAW_IMAGE=) and run ./openclaw update. If edge was newer than latest, this is a downgrade: data migrations are not reversible, so restore the backup made before you switched (see Backups and restoring).

Staying on an exact version

Set the version in .env and update:

OPENCLAW_IMAGE=ghcr.io/luprintech/openclaw-nas-docker:2026.11.6

./openclaw update keeps that version until you change it, and still runs the backup and migrations. Leave the value empty to follow latest again.

Older installers wrote version pins that froze updates, so the first ./openclaw update after this change clears a GHCR version pin once and records OPENCLAW_IMAGE_PIN_MIGRATED=1 in .env. Pins you set after that are kept.


Backups and restoring

Every ./openclaw update creates a folder next to your installation:

openclaw-backup-YYYYMMDD-HHMMSS/
├── openclaw-home/       # OpenClaw data: config, sessions, agents, workspace, Claude login
├── .env
├── docker-compose.yml
└── nginx/

After a successful update, only the two most recent backups are kept (the new one and the previous one); older ones are removed. To keep more, set OPENCLAW_KEEP_BACKUPS before running the update, for example OPENCLAW_KEEP_BACKUPS=5 ./openclaw update (0 keeps all of them). Set OPENCLAW_BACKUP_ROOT to store them somewhere else.

Backups contain your gateway token, provider keys and Claude login in plain text: keep them private.

To restore a backup (for example after a failed update):

  1. Stop the stack:

    cd /volume1/docker/openclaw
    ./openclaw stop
  2. Move the current data aside instead of deleting it:

    mv config config.before-restore
    mv workspace workspace.before-restore
  3. Copy the backup back with the right owner. A temporary container does the copy, because the SSH user may not be allowed to read files owned by UID 1000:

    B=openclaw-backup-YYYYMMDD-HHMMSS
    docker run --rm -v "$PWD:/w" alpine sh -c \
      "cp -a /w/$B/openclaw-home /w/config \
       && if [ -d /w/config/workspace ]; then mv /w/config/workspace /w/workspace; else mkdir /w/workspace; fi \
       && chown -R 1000:1000 /w/config /w/workspace"
  4. Pin the version you were running before the update (see the releases if you are not sure) in .env, for example:

    OPENCLAW_IMAGE=ghcr.io/luprintech/openclaw-nas-docker:2026.11.5
  5. Start the stack with ./openclaw start and check ./openclaw status.

When everything works, you can delete config.before-restore and workspace.before-restore. Once a fixed version is on latest, empty OPENCLAW_IMAGE and run ./openclaw update.


Re-running the installer

Re-run the installer only to change the NAS IP or HTTPS port, or to repair the installation:

./install.sh 192.168.1.60   # new IP
./install.sh                # same IP, read from .env

It keeps your token, data and certificate authority. It rewrites docker-compose.yml, issues a new HTTPS certificate, repairs file ownership and re-applies the allowed origins and proxy settings. Existing nginx/nginx.conf and ./openclaw files are left as they are.

The installer does not update OpenClaw: it does not pull a newer image or migrate data. Use ./openclaw update for that.

To change the HTTPS port, edit OPENCLAW_HTTPS_PORT in .env and re-run ./install.sh, so the allowed origins match the new port.


Installing rootCA on client devices

Windows

  1. Copy certs/rootCA.cer to the PC.
  2. Double-click it and choose Install Certificate.
  3. Choose Local Machine.
  4. Place it in Trusted Root Certification Authorities.

macOS

  1. Open rootCA.pem: Keychain Access adds it to the System keychain.
  2. Open the certificate and set When using this certificate to Always Trust.

iPhone / iPad

  1. Open rootCA.pem on the device and install the profile.
  2. Go to Settings → General → About → Certificate Trust Settings.
  3. Enable full trust for the certificate.

Android

Settings → Security → Encryption & credentials → Install a certificate → CA certificate

Menu names vary by manufacturer.

The certificate authority is created once and reused. Re-running the installer issues a new server certificate signed by the same authority, so devices that already trust it do not need to install it again.


Claude Code CLI

The image includes Claude Code. ./openclaw claude opens it in a temporary container, and the OpenClaw gateway can use the same CLI as its claude-cli model backend (see the OpenClaw CLI backends documentation).

Both containers set CLAUDE_CONFIG_DIR=/home/node/.openclaw/claude, which is config/claude on the NAS. Your Claude login, settings, memory and history live there, so they survive closing the CLI, restarting the stack and updating the image. Installations that update from an older release need to sign in once more.

Sign in once, then check the status:

./openclaw claude                # then run /login and follow the prompts
docker compose exec openclaw-gateway claude auth status --text

Claude Code accepts an Anthropic account login or an API key. For shared or continuous automation through the gateway, OpenClaw's documentation recommends an API key for predictable billing (Docker storage). If you sign in with an account, check Anthropic's current terms and usage limits for third-party tools.

config/claude stores your Claude login token in plain text, like the gateway token in .env. Do not share or commit it.


Installing Python skills

The container includes Python 3 and pip. Packages go into a virtual environment at /home/node/.openclaw/python-venv, inside config/, so they survive restarts and image updates.

./openclaw pip install <package>

If you get Unknown command: openclaw pip, your wrapper is outdated. Refresh it once:

curl -fsSL https://raw.githubusercontent.com/luprintech/openclaw-nas-docker/main/install.sh -o install.sh
bash install.sh --wrapper-only

From then on, ./openclaw update keeps the wrapper up to date.


Troubleshooting

OpenClaw gateway container is not running; start the stack before updating

Older versions of ./openclaw update stop with this message when the stack is not running, for example after ./openclaw stop or if the container was deleted in Container Manager. Current versions start it automatically. Your data in config/ and workspace/ is safe. Start the stack and update again:

./openclaw start
./openclaw update

Doctor could not enter maintenance / cannot verify Gateway ownership

The gateway did not release its state lock before the migration started, usually because it was killed instead of stopping cleanly. The update then ends with finished with N warning(s) and the data migration may not have finished. Wait a minute and run the update again:

./openclaw update

The stack gives the gateway up to 60 seconds to stop (90 seconds during an update; set OPENCLAW_STOP_TIMEOUT to change it), which normally prevents this.

The Control UI does not load after an update

You probably updated with docker compose pull / up -d instead of ./openclaw update, so the data migration did not run:

bash scripts/migrate-openclaw.sh upgrade

Plugin requires a newer plugin API than this OpenClaw runtime

Plugin "@openclaw/whatsapp" requires plugin API >=2026.10.1, but this OpenClaw
runtime exposes 2026.9.9.

The plugin was published for a newer OpenClaw version than the one you run. Update, check your version and retry:

./openclaw update
docker compose exec openclaw-gateway node dist/index.js --version

If the plugin still needs a newer version, that OpenClaw release has not reached latest yet (see Release channels). Wait for the next promotion or switch to edge if you accept the risk.

EACCES: permission denied

OpenClaw runs as UID/GID 1000 inside the container. If the data folders belong to another user you see errors like:

EACCES: permission denied, open '/home/node/.openclaw/openclaw.json...tmp'

Fix the owner with a temporary container (works without sudo):

docker run --rm -v "$PWD:/w" alpine chown -R 1000:1000 /w/config /w/workspace
./openclaw restart

If certificate generation fails with permission denied under certs/:

sudo chown -R "$(id -u):$(id -g)" certs
chmod -R u+rwX certs

Container name conflicts

Conflict. The container name "/openclaw-gateway" is already in use

These are leftovers from an older install that used fixed container names:

docker ps -a --filter name=openclaw
docker stop openclaw-gateway openclaw-cli openclaw-nginx 2>/dev/null || true
docker rm   openclaw-gateway openclaw-cli openclaw-nginx 2>/dev/null || true
./install.sh

The NAS IP changed

The dashboard URL, the certificate and the allowed origins still point to the old IP. Re-run the installer with the new one:

./install.sh <new-nas-ip>

Security rules

  • Do not port-forward 8443 or 18789 from the router.
  • Keep certs/ private, especially the certificate authority key.
  • Never share or commit .env, config/, logs/ or openclaw-backup-* folders: they contain your gateway token, logins and account details. Remove anything private before pasting a log into an issue.
  • Install only OpenClaw skills and plugins you trust.

The installer binds the gateway to 127.0.0.1 and Nginx to the NAS LAN IP, and configures Nginx to overwrite X-Forwarded-For with the real client address. It adds only the current Nginx container IP to gateway.trustedProxies, and ./openclaw update refreshes it. Do not replace it with a broad Docker subnet.


Support the project

If OpenClaw on NAS saves you time, the best way to support it is to ⭐ star the repository. Stars help other NAS users find it. Bug reports and pull requests are welcome too (see Contributing).


Project documents

About

Run OpenClaw on any Docker-capable NAS with LAN-only access, Nginx proxy, and optional local HTTPS.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages