一键部署
使用下面的一行��令,可以在 Linux 服务器上自动完成 NeutralPress 的 Docker 部署。
curl -fsSL https://get.neutralpress.net | bash脚本会自动完成下列操作:
- 下载
docker-compose.yml和.env.example - 创建
.env(如果不存在) - 自动生成
MASTER_SECRET、JWT_PRIVATE_KEY、JWT_PUBLIC_KEY - 如果未安装 Docker,会自动安装 Docker + Docker Compose(仅 Linux)
- 执行
docker compose up -d
前置条件
- 已安装
curl或wget - Linux 环境下可用 root 或 sudo(仅在自动安装 Docker 时需要)
常用参数
指定安装目录
curl -fsSL https://get.neutralpress.net | bash -s -- --workspace /opt/neutralpress指定镜像
curl -fsSL https://get.neutralpress.net | bash -s -- --artifact ghcr.io/ravelloh/neutralpress:latest仅准备配置,不启动容器
curl -fsSL https://get.neutralpress.net | bash -s -- --prepare-only指定网络模式(默认自动检测)
脚本会请求 https://ip.api.ravelloh.top/,根据 country 字段判断是否中���大陆网络(CN 视为中国大陆)。
# 强制按中国大陆网络处理
curl -fsSL https://get.neutralpress.net | bash -s -- --route-profile mainland
# 强制按非中国大陆网络处理
curl -fsSL https://get.neutralpress.net | bash -s -- --route-profile overseas禁用 Docker 自动安装
curl -fsSL https://get.neutralpress.net | bash -s -- --skip-engine-setup使用源码仓库的脚本
https://get.neutralpress.net 使用 Cloudflare Worker 反代下面的 GitHub 仓库文件,用以帮助访问无法访问 raw.githubusercontent.com 的用户。
你也可以直接从 GitHub 仓库获取最新版本的部署脚本:
curl -fsSL https://raw.githubusercontent.com/RavelloH/NeutralPress/main/scripts/deploy.sh | bash部署后常用命令
cd /opt/neutralpress
# 查看日志
docker compose logs -f web
# 关闭容器
docker compose down
# 在关闭容器后,重新启动容器
docker compose up -d
# 删除容器和数据卷
docker compose down -v