AIGCS

Installation

Complete installation guide for all deployment options

Depending on your server network environment, you can choose from the following Docker registries:

RegistryImage AddressDescription
Docker Hubopenaigcs/aigcs:latestOfficial default image
GitHub GHCRghcr.io/openaigcs/aigcs:latestGitHub Container Registry
Aliyun (ACR)registry.cn-shanghai.aliyuncs.com/openaigcs/aigcs:latestEast China 2 (Shanghai) node
CNB Registrydocker.cnb.cool/openaigcs/aigcs:latestTencent CNB registry

Using Docker Run

You can directly replace the image name in the command below with one of the mirrors above.

docker run -d \
  --name aigcs \
  -p 41905:41905 \
  -e JWT_SECRET="<your-secret>" \
  -e ENCRYPTION_KEY="<your-encryption-key>" \
  -v ./data:/app/data \
  openaigcs/aigcs:latest

Using Docker Compose

Create compose.yml:

services:
  aigcs:
    image: openaigcs/aigcs:latest
    container_name: aigcs
    ports:
      - "41905:41905"
    environment:
      - JWT_SECRET=<change-this>
      - ENCRYPTION_KEY=<change-this>
      - NODE_ENV=production
    volumes:
      - ./data:/app/data
    healthcheck:
      test: ["CMD", "wget", "--spider", "http://localhost:41905/api/health"]
      interval: 30s
      timeout: 10s
      retries: 3
docker compose up -d

Environment Variables

VariableDefaultRequiredDescription
PORT41905NoHTTP service port (leetspeak: aigcs → 41905)
DATABASE_URLfile:./data/aigcs.dbNoSQLite database file path
JWT_SECRETJWT signing secret (must change in production)
ENCRYPTION_KEYJWT_SECRETNoAES-256-GCM encryption key (recommended separate from JWT_SECRET)
RATE_LIMIT_MAX100NoMax requests per window
RATE_LIMIT_WINDOW60NoRate limit window (seconds)
SMTP_HOSTNoSMTP server address
SMTP_PORT587NoSMTP port
SMTP_USERNoSMTP username
SMTP_PASSNoSMTP password
SMTP_FROMNoSender email address
CAPTCHA_PROVIDERNoCaptcha type: turnstile / recaptcha / geetest / none
TURNSTILE_SITE_KEYNoCloudflare Turnstile Site Key
TURNSTILE_SECRET_KEYNoCloudflare Turnstile Secret Key
RECAPTCHA_SITE_KEYNoGoogle reCAPTCHA Site Key
RECAPTCHA_SECRET_KEYNoGoogle reCAPTCHA Secret Key
GEETEST_IDNoGeetest ID
GEETEST_KEYNoGeetest Key
ALLOWED_ORIGINS[]NoAllowed CORS origins (JSON array string)
REGISTRATION_OPENfalseNoWhether registration is open
GLOBAL_SYSTEM_PROMPTNoGlobal AI system prompt

Manual Deployment

Prerequisites

  • Node.js >= 24.0.0
  • pnpm >= 9.0.0

Steps

# Clone the repository
git clone https://github.com/openaigcs/aigcs.git
cd aigcs
 
# Install dependencies
pnpm install
 
# Build all packages
pnpm build
 
# Create .env.local with your config
echo 'JWT_SECRET=your-random-secret' > .env.local
 
# Start the server
pnpm --filter @aigcs/server start

The server starts on port 41905 by default.

Process Manager (PM2)

npm install -g pm2
pm2 start node --name aigcs -- packages/server/dist/index.js
pm2 save
pm2 startup

Systemd Service

[Unit]
Description=AIGCS Comment System
After=network.target
 
[Service]
Type=simple
User=node
WorkingDirectory=/opt/aigcs
ExecStart=/usr/local/bin/node packages/server/dist/index.js
Restart=always
Environment=NODE_ENV=production
 
[Install]
WantedBy=multi-user.target

Reverse Proxy

Nginx

server {
    listen 443 ssl;
    server_name comments.example.com;
 
    ssl_certificate /path/to/cert.pem;
    ssl_certificate_key /path/to/key.pem;
 
    location / {
        proxy_pass http://127.0.0.1:41905;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Caddy

comments.example.com {
    reverse_proxy 127.0.0.1:41905
}

EdgeOne Makers [WIP]

EdgeOne Makers deployment is planned but not yet implemented.

EdgeOne Makers support requires the @aigcs/edgeone package.

# Build EdgeOne Makers bundle
pnpm edgeone:build
 
# Deploy to EdgeOne Makers
# The output is in cloud-functions/

Cloudflare Workers [WIP]

Cloudflare Workers deployment is planned but not yet implemented.

Vercel [WIP]

Vercel deployment is planned but not yet implemented.

One-Click Platforms

Railway

Deploy on Railway

Render

# render.yaml
services:
  - type: web
    name: aigcs
    env: docker
    repo: https://github.com/openaigcs/aigcs
    envVars:
      - key: JWT_SECRET
        generateValue: true

Upgrading

Docker

docker compose pull
docker compose up -d

Manual

git pull
pnpm install
pnpm build
# Restart the server