What this step is
Prepare the tools for the next step: a terminal to type commands into, and — on the AI route — an AI assistant that runs commands for you.
Whichever route you take, you need to be able to open a terminal: the manual route types commands there, and the AI route may ask you to type the server password there once.
Test first: can your AI run commands?
If you already have an AI tool, tell it:
Please run whoami on my computer and tell me the result.- It actually runs it and answers with a user name: it works. Once you can open a terminal (first thing below), skip “install an AI assistant” and go straight to step 3.
- It tells you to run it yourself, or says it can’t: it’s chat-only and can’t do this for you. Install Claude Code or Codex below, or take the manual route.
On Windows, also have it run uname -a: the answer must include Linux, meaning it works inside WSL (the setup’s scripts only run there). If not, install one inside WSL as below.
First: open a terminal
Mac has Terminal built in: press ⌘ + Space, type “Terminal” and press Enter. A window appears with a line ending in % or $ — that’s the terminal.
This setup’s scripts run in Linux, so Windows first needs its built-in Linux environment, WSL. About 10 minutes and one restart.
Follow Install WSL on Windows, then come back. From now on, “terminal” on Windows means the Ubuntu window inside WSL.
Manual route: you’re done here
If you won’t use AI, the terminal is all you need. Go to the next step and choose “Type it yourself”.
No AI that runs commands yet: install one
Pick one — whichever you have an account for:
| Claude Code | Codex | |
|---|---|---|
| From | Anthropic (Claude) | OpenAI (ChatGPT) |
| Account needed | Claude Pro, Max, Team, Enterprise or Console (not the free plan) | A paid ChatGPT plan such as Plus, Pro, Business, Edu or Enterprise |
Paste this into the terminal and press Enter (same command on Mac and in WSL):
curl -fsSL https://claude.ai/install.sh | bashWhen it finishes, close the terminal and open it again, then check — a version number means it worked:
claude --versionThen type claude, press Enter and log in to your Claude account in the browser when prompted. Details: Install Claude Code.
Paste this into the terminal and press Enter (same command on Mac and in WSL):
curl -fsSL https://chatgpt.com/codex/install.sh | shWhen it finishes, close the terminal and open it again, then check — a version number means it worked:
codex --versionThen type codex, press Enter, choose “Sign in with ChatGPT” and log in in the browser. Details: Install Codex.
Optional: install it as a skill
If you’ll set up servers often, install this setup as an AI skill; afterwards one sentence — “use xiaoxiaodong-vps to set up my new server” — is enough. Not needed the first time: the message in the next step tells the AI to download the setup itself. See Install the xiaoxiaodong-vps skill.
Stuck?
It says command not found?
Close and reopen the terminal after installing so the new command is found. Still failing? See the matching how-to.
The browser didn't open for login?
The terminal prints a URL — copy it into a browser, log in, then return to the terminal.
Can I skip WSL on Windows and use PowerShell?
The AI assistants themselves run on Windows, but this setup’s scripts need Linux tools like bash and ssh, which are easiest in WSL — so the guide uses WSL throughout.
Before moving on, check
✓ All ticked — on to the next step.