본문으로 건너뛰기

Cursor 서버 수동 설치 가이드

이 가이드에서는 Cursor 서버를 수동으로 설치하고 구성하는 방법을 단계별로 설명합니다.

사전 요구 사항

시스템 요구 사항

  • 운영체제: Windows 10/11, macOS 10.15+, Linux (Ubuntu 20.04+)
  • CPU: 2코어 이상
  • RAM: 최소 4GB (8GB 권장)
  • 저장 공간: 최소 1GB 여유 공간
  • 네트워크: 안정적인 인터넷 연결

필수 소프트웨어

  • Node.js 16.x 이상
  • npm 7.x 이상
  • Git

설치 단계

1. 저장소 클론

# Cursor 서버 저장소 클론
git clone https://github.com/getcursor/cursor-server.git
cd cursor-server

2. 의존성 설치

# npm 패키지 설치
npm install

# 또는 yarn 사용
yarn install

3. 환경 설정

.env 파일을 생성하고 필요한 환경 변수를 설정합니다:

# 서버 설정
PORT=3000
HOST=localhost

# 데이터베이스 설정
DB_HOST=localhost
DB_PORT=5432
DB_NAME=cursor
DB_USER=your_username
DB_PASSWORD=your_password

# 보안 설정
JWT_SECRET=your_jwt_secret

4. 데이터베이스 설정

PostgreSQL 데이터베이스를 설정합니다:

# PostgreSQL 설치 (Ubuntu)
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib

# 데이터베이스 생성
sudo -u postgres psql
CREATE DATABASE cursor;
CREATE USER your_username WITH ENCRYPTED PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE cursor TO your_username;

5. 서버 빌드

# 프로덕션 빌드
npm run build

# 또는 개발 빌드
npm run build:dev

6. 서버 시작

# 프로덕션 모드
npm start

# 또는 개발 모드
npm run dev

구성 옵션

1. 포트 설정

config.json에서 포트를 변경할 수 있습니다:

{
"server": {
"port": 3000,
"host": "localhost"
}
}

2. SSL/TLS 설정

HTTPS를 활성화하려면:

{
"server": {
"ssl": {
"enabled": true,
"cert": "/path/to/cert.pem",
"key": "/path/to/key.pem"
}
}
}

3. 로깅 설정

{
"logging": {
"level": "info",
"file": "/path/to/logs/cursor-server.log"
}
}

문제 해결

1. 포트 충돌

# 사용 중인 포트 확인
netstat -tulpn | grep LISTEN

# 다른 포트 사용
PORT=3001 npm start

2. 데이터베이스 연결 오류

# PostgreSQL 서비스 상태 확인
sudo systemctl status postgresql

# 연결 테스트
psql -h localhost -U your_username -d cursor

3. 권한 문제

# 로그 파일 권한 확인
ls -l /path/to/logs/

# 권한 수정
chmod 755 /path/to/logs/

모니터링 및 유지 관리

1. 로그 확인

# 실시간 로그 보기
tail -f /path/to/logs/cursor-server.log

# 오류 로그 필터링
grep ERROR /path/to/logs/cursor-server.log

2. 성능 모니터링

# CPU 사용량 확인
top -p $(pgrep -f cursor-server)

# 메모리 사용량 확인
pm2 monit

3. 백업 설정

# 데이터베이스 백업
pg_dump -U your_username cursor > backup.sql

# 설정 파일 백업
cp config.json config.json.backup

보안 고려 사항

1. 방화벽 설정

# UFW 설정 (Ubuntu)
sudo ufw allow 3000/tcp
sudo ufw enable

2. SSL/TLS 인증서

Let's Encrypt를 사용한 인증서 발급:

sudo certbot certonly --standalone -d your-domain.com

3. 접근 제어

{
"security": {
"allowed_ips": ["192.168.1.0/24"],
"rate_limit": {
"window": 900,
"max": 100
}
}
}

업데이트 및 유지 관리

1. 서버 업데이트

# 최신 코드 가져오기
git pull origin main

# 의존성 업데이트
npm install

# 서버 재시작
npm run build
npm start

2. 데이터베이스 마이그레이션

# 마이그레이션 실행
npm run migrate

# 롤백
npm run migrate:rollback

결론

Cursor 서버를 수동으로 설치하면 더 많은 제어와 커스터마이징이 가능합니다. 이 가이드의 단계를 따르면 안정적이고 보안이 강화된 서버를 구성할 수 있습니다.

추가 리소스: