本地安装

使用自动安装程序搭建本地 Solana 开发环境。该程序会在 macOS、Linux 或通过 WSL 的 Windows 上安装 Rust、Solana CLI、Anchor CLI、Surfpool CLI、Node.js 和 Yarn。

Windows 需要 WSL

在 Windows PowerShell 中运行 wsl --install,如有提示请重启 Windows,然后在 Ubuntu 终端中运行下方的安装命令。完整的 WSL 设置请参阅手动安装指南。

快速安装

  1. 在 macOS、Linux 或 WSL 终端中运行安装程序:
Terminal
$
curl --proto '=https' --tlsv1.2 -sSfL https://solana-install.solana.workers.dev | bash

运行前,您可以查看安装程序源码。安装程序会检测受支持的 Linux 包管理器,并自动安装其系统依赖项。

  1. 重启终端,使新命令在 PATH 中生效。

  2. 验证每个工具:

Terminal
$
rustc --version
$
solana --version
$
anchor --version
$
surfpool --version
$
node --version
$
yarn --version

安装成功后,将返回如下形式的输出(版本号会随工具发布而变化):

Example output
Installed Versions:
Rust: rustc x.y.z (...)
Solana CLI: solana-cli x.y.z (..., client:Agave)
Anchor CLI: anchor-cli x.y.z
Surfpool CLI: surfpool x.y.z
Node.js: vx.y.z
Yarn: x.y.z

安装程序失败或缺少命令

请按照手动安装指南逐个安装依赖项或排查问题。

本地开发资源

Is this page helpful?

Table of Contents

Edit Page
©️ 2026 Solana 基金会版权所有