English | Español
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.
- Requirements
- Video tutorial
- First install, step by step
- Everyday commands
- Updating OpenClaw
- Release channels
- Backups and restoring
- Re-running the installer
- Installing rootCA on client devices
- Claude Code CLI
- Installing Python skills
- Troubleshooting
- Security rules
- Support the project
- Project documents
- A NAS with an x86-64 (amd64) CPU. Images are published for
linux/amd64only, so ARM-based models cannot run them. - Docker with Docker Compose v2 (
docker compose versionmust work). On Synology, install Container Manager from the Package Center. - SSH access to the NAS with a user that can run
docker. curlon 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.).
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
8443or18789from your router.
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
- Open your router admin page and find the NAS in the DHCP / LAN clients list.
- Copy its MAC address.
- Create a DHCP reservation (also called static lease or address reservation)
for that MAC, for example
192.168.1.50. - Reboot the NAS or renew its network lease.
- Confirm the NAS answers on that IP.
Synology DSM: set a manual IP from the UI
- In DSM, open Control Panel → Network → Network Interface.
- Select your active interface (usually LAN 1) and click Edit.
- In IPv4, choose manual configuration and set the IP (for example
192.168.1.50), subnet mask (usually255.255.255.0), gateway (your router, for example192.168.1.1) and DNS server. - 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.
| 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/openclawOn Synology, enable SSH first in Control Panel → Terminal & SNMP.
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.50Run 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.
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.cerfor Windowscerts/rootCA.pemfor 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.
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./openclaw onboardOnboarding 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 startOnly 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.
Pairing authorizes your browser as a known device.
-
Print the dashboard and pairing information:
./openclaw dashboard
-
Open the printed URL in your browser, enter the gateway token if asked and start the pairing flow.
-
Back in SSH, list pending devices:
./openclaw devices
-
Copy the
request_idof your browser and approve it:./openclaw approve <request_id>
-
Refresh the browser. It is now paired.
./openclaw status
./openclaw doctorstatus should show both containers as Up and the gateway as healthy. If
something fails, look at the logs:
./openclaw logs openclaw-gateway
./openclaw logs nginxPress Ctrl+C to stop following the logs.
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 |
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 updateIt 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:
- Downloads the latest
install.sh,docker-compose.yml,openclawandscripts/migrate-openclaw.shfrom this repository (or runsgit pullif the folder is a Git clone). The files are checked before they replace the current ones, so a failed download changes nothing. - Pulls the configured image (
:latestby default). If OpenClaw was stopped, it is started first, because the backup is taken from it. - Backs up your OpenClaw data,
.env,docker-compose.ymlandnginx/into a newopenclaw-backup-<date>-<time>folder (see Backups and restoring). - Stops the gateway, giving it up to 90 seconds to shut down cleanly.
- Repairs file ownership and runs the data migrations required by the new
OpenClaw version (
openclaw doctor --fix --non-interactiveand the session import). - 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 pullandup -dalone. 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, runbash 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-gatewayThe 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 updateEvery 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-dockerHow a new OpenClaw version reaches latest:
- Every six hours a workflow checks for a new stable OpenClaw release (prereleases are ignored).
- CI builds the image and runs
scripts/smoke-test.sh: clean start, upgrade from the currentlateston the same data, healthy gateway, no degraded agent database and a workingclaudeCLI. If anything fails, nothing is published and an issue labelledopenclaw-update-failedis opened. - If the tests pass, a pull request pins the version on
mainand is merged automatically. The image is published as:<version>and:edgeon GHCR and Docker Hub, with a GitHub prerelease and an issue labelledrelease-candidatethat contains the NAS checklist. - 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
openat2call). - The maintainer runs the Promote to stable workflow. It copies that exact
image to
:lateston both registries without rebuilding it, marks the GitHub release as latest and closes the checklist issue. Running it with an older version rollslatestback.
After a promotion or a rollback, run ./openclaw update on your NAS to get it.
-
Edit
.envand set:OPENCLAW_IMAGE=ghcr.io/luprintech/openclaw-nas-docker:edge
-
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).
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.
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):
-
Stop the stack:
cd /volume1/docker/openclaw ./openclaw stop -
Move the current data aside instead of deleting it:
mv config config.before-restore mv workspace workspace.before-restore
-
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"
-
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
-
Start the stack with
./openclaw startand 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-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 .envIt 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.
- Copy
certs/rootCA.certo the PC. - Double-click it and choose Install Certificate.
- Choose Local Machine.
- Place it in Trusted Root Certification Authorities.
- Open
rootCA.pem: Keychain Access adds it to the System keychain. - Open the certificate and set When using this certificate to Always Trust.
- Open
rootCA.pemon the device and install the profile. - Go to Settings → General → About → Certificate Trust Settings.
- Enable full trust for the certificate.
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.
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 --textClaude 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.
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-onlyFrom then on, ./openclaw update keeps the wrapper up to date.
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 updateThe 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 updateThe 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.
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 upgradePlugin "@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 --versionIf 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.
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 restartIf certificate generation fails with permission denied under certs/:
sudo chown -R "$(id -u):$(id -g)" certs
chmod -R u+rwX certsConflict. 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.shThe 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>- Do not port-forward
8443or18789from the router. - Keep
certs/private, especially the certificate authority key. - Never share or commit
.env,config/,logs/oropenclaw-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.
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).

