Arama Yap Mesaj Submit
Request a Callback
+90
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro

Contact Us

Location Halkali merkez neighborhood fatih st ozgur apt no 46 , Kucukcekmece , Istanbul , 34303 , TR
OpenClaw, Windows VPS, OpenAI Codex OAuth and Telegram

OpenClaw on a Windows VPS: Complete Illustrated Setup Guide

This guide documents a real OpenClaw deployment built from scratch on Windows Server 2022. We connect a ChatGPT account with OpenAI Codex OAuth, choose a model, verify the Gateway and Dashboard, pair a Telegram bot, preserve the real troubleshooting steps, and reboot the VPS to prove that OpenClaw and Telegram return automatically without a manual start command.

OpenClawOpenClaw WindowsWindows VPSWindows Server 2022OpenAI CodexChatGPT OAuthGPT-5.6 SolTelegram BotOpenClaw GatewayScheduled TaskAI AgentSelf Hosted AI
OpenClaw Gateway / Windows VPS
OpenClaw CLI → OpenAI/Codex OAuth
openai/gpt-5.6-sol → Agent
127.0.0.1:18789 → OpenClaw Gateway
Telegram Bot → Pairing → 7/24
Windows Scheduled Task → reboot recovery
Gateway127.0.0.1:18789ChannelTelegram
40selected real screenshots
3TR · EN · DE content
18789Local Gateway
24/7Reboot-tested auto-start
01Native Windows PowerShell installation
02ChatGPT/Codex OAuth and model selection
03Telegram bot, pairing and live probe
04Full reboot and automatic Gateway recovery
00
Table of contents

OpenClaw Windows VPS setup steps

  1. 01Why we deployed OpenClaw as an always-on service on a Windows VPS
  2. 02Run PowerShell as Administrator
  3. 03Install OpenClaw and let the installer provision Node.js
  4. 04Complete onboarding and register the OpenClaw Gateway task
  5. 05Connect your ChatGPT account with OpenAI Codex OAuth
  6. 06Verify the OAuth profile and set a default model
  7. 07Verify the Gateway and send the first real message from Dashboard
  8. 08Create a Telegram bot for OpenClaw
  9. 09Use tokenFile instead of putting the Telegram token in shell history
  10. 10Interpret post-restart Telegram probe errors correctly
  11. 11Approve the Telegram user with a pairing code
  12. 12Send a new Telegram message and verify a real AI reply
  13. 13Reboot the VPS without manually starting OpenClaw
  14. 14Verify automatic Dashboard and Telegram recovery
  15. 15Monitor Gateway, sessions and model from OpenClaw Overview
  16. 16Turn plugin and channel errors into a useful troubleshooting section
  17. 17Make update, restart and log checks part of normal operations
  18. 18Keep the Gateway local and protect OAuth and Telegram secrets
01
Goal and architecture

Why we deployed OpenClaw as an always-on service on a Windows VPS

This guide documents a real OpenClaw deployment on Windows Server 2022. We do more than install the CLI: we complete OpenAI Codex OAuth, select a model, register the Gateway as a managed Windows task, verify the Control UI, pair Telegram and perform a full reboot test without manually starting OpenClaw afterward.

The native PowerShell path was used. The Gateway listened locally on 127.0.0.1:18789 and Telegram used the Gateway. Our test selected openai/gpt-5.6-sol; model names and availability can vary by account and release.

Step 1
Windows VPS → OpenClaw Gateway :18789 → OpenAI/Codex OAuth
                                      ↓
                                Telegram Bot
02
Windows preparation

Run PowerShell as Administrator

Administrator PowerShell makes installer, PATH and managed Gateway operations more predictable on Windows Server.

Take a VPS snapshot before larger runtime changes, especially when other Node or Python services share the same server.

03
Official installer

Install OpenClaw and let the installer provision Node.js

The Windows installer detects the operating system, provisions a supported Node.js runtime when needed and installs OpenClaw. Node.js was missing on our VPS, so a portable runtime was installed under LocalAppData and added to the user PATH.

After Node was ready, the latest OpenClaw package was installed and setup started.

Step 1
iwr -useb https://openclaw.ai/install.ps1 | iex
04
Initial configuration

Complete onboarding and register the OpenClaw Gateway task

The first onboarding screen reports workspace, model-provider state and Gateway mode. After approving the basic setup, OpenClaw prepared its workspace/session paths and installed a Windows Scheduled Task for the Gateway.

In this test the task was registered as OpenClaw Gateway, allowing managed background startup without a permanently open PowerShell window.

Step 1
yes
05
OpenAI Codex OAuth

Connect your ChatGPT account with OpenAI Codex OAuth

The base setup can finish without a model provider, so the agent could not answer yet. We left the TUI and started OpenAI provider OAuth from a normal PowerShell prompt. OpenClaw opened auth.openai.com and used a localhost callback.

After choosing the ChatGPT account and approving Codex access, Authentication successful confirmed the flow.

Step 1
openclaw models auth login --provider openai
06
Model verification

Verify the OAuth profile and set a default model

We used openclaw models status to confirm a usable OAuth profile, then listed OpenAI models. openai/gpt-5.6-sol was available and configured during this test.

Do not treat one model identifier as permanent. Select an appropriate model actually available to your account and OpenClaw version.

Step 1
openclaw models status
Step 2
openclaw models list --provider openai
Step 3
openclaw models set openai/gpt-5.6-sol
07
Control UI

Verify the Gateway and send the first real message from Dashboard

After selecting the model we verified Gateway health and opened the Control UI with openclaw dashboard.

The first message asked the agent to identify the model and Windows VPS environment. The live agent responded successfully.

Step 1
openclaw gateway status --require-rpc
Step 2
openclaw dashboard
08
Telegram BotFather

Create a Telegram bot for OpenClaw

We created a bot with /newbot in BotFather, then selected a display name and a unique username ending in bot.

The returned HTTP Bot API token controls the bot and must be treated as a secret. The test token shown in our screenshots is temporary and should be revoked before publication.

Step 1
/newbot
09
Secret handling

Use tokenFile instead of putting the Telegram token in shell history

Instead of typing the token into a PowerShell command, we stored it under the user's .openclaw directory and passed only the file path.

The first attempt without a token returned Telegram requires token; --token-file then created the channel successfully.

Step 1
notepad "$env:USERPROFILE\.openclaw\telegram-token.txt"
Step 2
openclaw channels add --channel telegram --token-file "$env:USERPROFILE\.openclaw\telegram-token.txt"
10
Live connectivity

Interpret post-restart Telegram probe errors correctly

Immediately after restarting the Gateway, the live channel probe briefly returned 1006 abnormal closure.

Once Gateway startup completed, channels status --probe reported Telegram as running, connected and works. Do not rebuild a correct configuration because the first post-restart probe was too early.

Step 1
openclaw gateway restart
Step 2
openclaw gateway status --require-rpc
Step 3
openclaw channels status --probe
11
DM access control

Approve the Telegram user with a pairing code

On the first DM OpenClaw did not grant access automatically. The bot returned the Telegram user id, a short-lived pairing code and the owner approval command.

We reviewed the pending request in PowerShell and approved only our own account.

Step 1
openclaw pairing list telegram
Step 2
openclaw pairing approve telegram PAIRING_CODE
12
End-to-end test

Send a new Telegram message and verify a real AI reply

Messages sent before pairing approval may not be replayed automatically, so we sent a fresh message after approval.

Telegram showed the bot typing and then delivered the OpenClaw reply, validating the VPS, Gateway, OAuth, selected model and channel together.

Step 1
Hello. Confirm which model you use, which operating system you run on, and that this message arrived through Telegram.
13
Windows reboot

Reboot the VPS without manually starting OpenClaw

For an always-on deployment the most important validation is a full reboot. We used Restart-Computer -Force and did not run any OpenClaw start or restart command after Windows returned.

Refreshing the old Dashboard tab immediately produced ERR_CONNECTION_REFUSED. This was temporary: Windows was available, but the managed Gateway task had not started listening on port 18789 yet.

Step 1
Restart-Computer -Force
14
Automatic recovery

Verify automatic Dashboard and Telegram recovery

After a short wait the Dashboard became reachable without manual intervention. We sent a Telegram verification message without starting OpenClaw from PowerShell.

In this specific VPS test the agent reported that gateway.cmd started the Gateway roughly 21 seconds after Windows boot. Telegram reconnected and delivered the response. The 21-second value is test-specific, not a universal startup guarantee.

Step 1
The Windows VPS has rebooted. I did not run any OpenClaw command. Are you running automatically now? Verify the OS and Telegram connection.
15
Operations UI

Monitor Gateway, sessions and model from OpenClaw Overview

Overview provides a compact view of the Gateway URL, status, uptime, recent channel refresh, sessions and recent activity.

Our final screenshot shows the Telegram session and gpt-5.6-sol together. Empty cards can be normal depending on enabled features and runtime mode.

Step 1
openclaw dashboard
16
Real error records

Turn plugin and channel errors into a useful troubleshooting section

On Windows we observed ERR_REQUIRE_ESM_RACE_CONDITION from the Codex plugin. Despite the warning, OAuth remained usable and real Dashboard/Telegram inference worked. Always combine log interpretation with functional testing.

Telegram requires token, unknown channel and 1006 abnormal closure had different causes: missing secret, a channel not yet added, or Gateway readiness after restart. Isolate the layer with status, Gateway status, channel probe and logs.

Step 1
openclaw status
Step 2
openclaw gateway status
Step 3
openclaw channels status --probe
Step 4
openclaw logs --follow
Step 5
openclaw doctor
17
Maintenance

Make update, restart and log checks part of normal operations

OpenClaw changes quickly. Take a VPS snapshot before larger updates and repeat Gateway and Telegram probe tests afterward.

For incidents, check openclaw status and gateway status first, then channels status --probe, logs --follow and doctor.

Step 1
openclaw status
Step 2
openclaw gateway restart
Step 3
openclaw channels status --probe
Step 4
openclaw logs --follow
Step 5
openclaw doctor
18
Production security

Keep the Gateway local and protect OAuth and Telegram secrets

The Gateway remained on loopback in this deployment. Do not expose a local administrative interface directly to the Internet just for convenience; use a supported secure remote-access design with explicit authentication when remote administration is required.

Telegram Bot API tokens, OAuth data, auth profiles and Gateway tokens are secrets. Revoke an exposed token immediately. A screenshot containing an old token is safe only after that exact credential is invalidated or the value is redacted.

Production checklist

OpenClaw production security checklist

Do not expose the local Gateway administration endpoint directly to the public Internet without a secure access design.
Treat Telegram Bot API tokens and OpenAI OAuth data as secrets.
If a bot token is exposed, revoke it in BotFather and generate a new one.
Verify the Telegram user id before approving pairing.
Verify automatic Gateway startup with a real Windows reboot test.
Take a VPS snapshot before major OpenClaw updates.
Use channels status --probe and gateway status as routine health checks.
Only publish screenshots with credentials after invalidation or redaction.
R
Official source

Official OpenClaw and Telegram references

+
EKA Sunucu

Related EKA Sunucu guides and services

?
FAQ

Frequently asked questions about OpenClaw on Windows VPS

Does OpenClaw run on Windows Server 2022?

The native PowerShell path was successfully tested on Windows Server 2022 Standard Evaluation in this guide. Repeat reboot and channel tests on your own edition.

Must PowerShell stay open?

No. Managed Gateway startup uses a Windows Scheduled Task, so a foreground PowerShell window is not required.

Which port does the Gateway use?

Our test Gateway listened on loopback at 127.0.0.1:18789. Do not expose a local administrative port directly to the public Internet.

Can OpenClaw use a ChatGPT subscription?

The OpenAI provider can use ChatGPT/Codex OAuth. Available models and limits depend on the account.

Why does Telegram return a pairing code?

Unknown DM senders are not trusted automatically. The Gateway owner reviews and approves the intended sender.

How do I fix Telegram requires token?

Supply the BotFather token directly or through tokenFile. This guide uses --token-file to avoid putting the secret in shell history.

What is 1006 abnormal closure?

In our test it appeared during a probe immediately after Gateway restart. Once the Gateway was ready, the probe returned works.

Why did Dashboard show ERR_CONNECTION_REFUSED after reboot?

Windows was up, but the Scheduled Task had not started listening on port 18789 yet. On this VPS it recovered automatically about 21 seconds after boot.

Will OpenClaw start automatically after every reboot?

That is the purpose of managed startup, but verify it with a real reboot on your own VPS. Our Windows Server 2022 test succeeded.

Can I deploy this on an EKA Sunucu Windows VPS?

Yes, on a suitable Windows VPS with administrator access. Resource needs depend on the enabled tools and model runtime.

EKA YAZILIM VE BİLİŞİM SİSTEMLERİ

Need a Windows VPS for OpenClaw?

Explore EKA Sunucu Windows VPS plans to run an always-on OpenClaw Gateway, Telegram bot and AI-agent deployment on your own server.

Updated: 09.08.2026
View Windows VPS PlansAI & VPS Guides
Top