• moog

    服务器要求
    系统:Ubuntu 22.04 或 Ubuntu 20.04(64 位)
    配置:最低 1 核 2G,建议 2 核 2G 或以上
    硬盘:至少 40G
    网络:有公网 IP
    权限:能用 root,或有 sudo 权限

    1. 更新系统

    apt update && apt upgrade -y

    2. 常用工具

    apt install -y curl wget ca-certificates gnupg lsb-release git nano ufw openssl

    3. 安装 Docker

    install -m 0755 -d /etc/apt/keyrings
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
    chmod a+r /etc/apt/keyrings/docker.gpg
    echo "deb  https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo $VERSION_CODENAME) stable" > /etc/apt/sources.list.d/docker.list
    apt update
    apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    systemctl enable --now docker
    docker --version

    4. 放行端口(云安全组也要开 22 和 3000)

    ufw allow 22/tcp
    ufw allow 3000/tcp
    ufw allow 80/tcp
    ufw allow 443/tcp
    ufw --force enable

    5. 目录 + 密钥

    mkdir -p /opt/new-api/data /opt/new-api/logs
    cd /opt/new-api
    openssl rand -hex 32 > /opt/new-api/SESSION_SECRET.txt
    chmod 600 /opt/new-api/SESSION_SECRET.txt

    6. 启动 New API

    docker rm -f new-api 2>/dev/null || true
    docker run -d \
      --name new-api \
      --restart always \
      -p 3000:3000 \
      -e TZ=Asia/Shanghai \
      -e SESSION_SECRET="$(cat /opt/new-api/SESSION_SECRET.txt)" \
      -v /opt/new-api/data:/data \
      -v /opt/new-api/logs:/app/logs \
      calciumion/new-api:latest
    服务器自行选购  推荐使用宝塔面板

    主楼
  • mog

    AI中转站搭建教程和配置,收藏学习。

    #1
  • lukelee

    中转一般怎么找上游渠道啊大佬

    #2
  • mog

    这里问 这里问

    #3
  • 233

    一般都在tg上

    #4

发表回复

登录后回复