> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CometAPI와 함께 로컬에서 n8n 실행하기

> 이 가이드를 사용해 로컬 배포 설정, 자격 증명, 모델 액세스를 구성하여 CometAPI와 함께 n8n을 로컬에서 실행하세요.

자체 머신에 n8n을 배포하고 커뮤니티 노드를 통해 CometAPI에 연결하여 자동화된 AI 워크플로를 로컬에서 실행하세요.

## 사전 준비 사항

* Linux(Ubuntu/Debian/CentOS 등) 또는 macOS
* RAM 2GB 이상, 여유 디스크 공간 10GB 이상
* 공개 npm 레지스트리에 접근 가능한 셸 환경
* Node.js 18.x 또는 20.x LTS(1단계 참고)
* 활성 API 키가 있는 CometAPI 계정 — [여기에서 발급받기](https://www.cometapi.com/console/token)

<Steps>
  <Step title="CometAPI API 키 가져오기">
    [CometAPI 콘솔](https://www.cometapi.com/console/token)에 로그인합니다. **Add API Key**를 클릭하고 CometAPI API 키를 복사합니다.

    <Frame>
      <img src="https://mintcdn.com/cometapi/SZhlxZhCnMLn__BW/images/overview/810968_364191.png?fit=max&auto=format&n=SZhlxZhCnMLn__BW&q=85&s=aef81a83f29f8eb16655ed4060425f50" alt="Add API Key 버튼이 표시된 CometAPI 대시보드" width="3824" height="1892" data-path="images/overview/810968_364191.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cometapi/HhtmQffktazbxUvS/images/overview/810968_364193.png?fit=max&auto=format&n=HhtmQffktazbxUvS&q=85&s=d893f659267150d0faf45f99eb5dffc1" alt="base URL이 포함된 CometAPI API 키 세부 정보" width="2434" height="1232" data-path="images/overview/810968_364193.png" />
    </Frame>
  </Step>

  <Step title="nvm으로 Node.js 설치">
    n8n 1.x는 Node.js 18.x 또는 20.x가 필요합니다. 권장 방법은 [nvm](https://github.com/nvm-sh/nvm)입니다:

    ```bash theme={null}
    # Install nvm
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

    # Reload your shell profile
    source ~/.bashrc   # or ~/.zshrc on macOS

    # Install and activate the LTS version
    nvm install --lts
    nvm use --lts

    # Verify
    node -v
    npm -v
    ```

    <Note>
      나중에 `n8n: command not found`가 표시되면 터미널을 다시 시작하거나, nvm이 관리하는 npm 전역 bin 디렉터리가 `PATH`에 포함되어 있는지 확인하세요.
    </Note>
  </Step>

  <Step title="n8n 설치 및 시작">
    ```bash theme={null}
    npm install -g n8n
    n8n -v       # verify the installed version
    n8n start    # runs on http://localhost:5678/
    ```

    포트 5678이 이미 사용 중인 경우:

    ```bash theme={null}
    export N8N_PORT=5679
    n8n start
    ```

    터미널을 닫은 뒤에도 n8n이 계속 실행되도록 하려면:

    ```bash theme={null}
    npm install -g pm2
    pm2 start "n8n" --name n8n
    pm2 save
    pm2 status
    ```

    <Frame>
      <img src="https://mintcdn.com/cometapi/SZhlxZhCnMLn__BW/images/integrations/810968_360463.png?fit=max&auto=format&n=SZhlxZhCnMLn__BW&q=85&s=80fe6068a8af4ec3b3503ff41d378a17" alt="n8n이 성공적으로 시작되는 모습을 보여주는 터미널" width="715" height="451" data-path="images/integrations/810968_360463.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cometapi/SZhlxZhCnMLn__BW/images/integrations/810968_360464.png?fit=max&auto=format&n=SZhlxZhCnMLn__BW&q=85&s=77cadfd218dbe0fef19fe701550ea363" alt="터미널에 표시된 n8n 시작 로그" width="759" height="460" data-path="images/integrations/810968_360464.png" />
    </Frame>
  </Step>

  <Step title="Owner 계정 만들기">
    브라우저에서 [http://localhost:5678/](http://localhost:5678/)을 엽니다. 처음 실행하면 설정 마법사에서 **Owner** 계정(이메일 + 비밀번호)을 만들도록 요청합니다. 이 과정을 완료하고 로그인하세요.

    <Frame>
      <img src="https://mintcdn.com/cometapi/SZhlxZhCnMLn__BW/images/integrations/810968_360465.png?fit=max&auto=format&n=SZhlxZhCnMLn__BW&q=85&s=8fdd100138f2bf01bbf834d9db1ea29e" alt="Owner 계정 정보를 요청하는 n8n 최초 실행 설정 마법사" width="1249" height="970" data-path="images/integrations/810968_360465.png" />
    </Frame>
  </Step>

  <Step title="CometAPI 커뮤니티 노드 설치">
    1. **Settings**(좌측 하단) → **Community nodes**로 이동합니다.
    2. **Install a community node**를 클릭합니다.
    3. 패키지 이름 `@cometapi-dev/n8n-nodes-cometapi`를 입력합니다.
    4. 위험 고지 확인란을 선택하고 **Install**을 클릭합니다.

    설치가 완료되면 노드 패널에서 **CometAPI**를 검색할 수 있습니다.

    <Frame>
      <img src="https://mintcdn.com/cometapi/SZhlxZhCnMLn__BW/images/integrations/810968_360467.png?fit=max&auto=format&n=SZhlxZhCnMLn__BW&q=85&s=1c107922e16332157d278bf834b3e32a" alt="Community nodes 섹션이 표시된 n8n Settings 패널" width="1265" height="975" data-path="images/integrations/810968_360467.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cometapi/SZhlxZhCnMLn__BW/images/integrations/810968_360468.png?fit=max&auto=format&n=SZhlxZhCnMLn__BW&q=85&s=98c05d77cb6adf333052b4d5014fc506" alt="CometAPI 패키지 이름이 입력된 설치 대화상자" width="1261" height="965" data-path="images/integrations/810968_360468.png" />
    </Frame>

    <Note>
      Community Nodes 섹션이 보이지 않는 경우: **Owner** 계정으로 로그인했는지 확인하고, **Settings → Security**에서 커뮤니티 노드 설치가 활성화되어 있는지 확인하세요.
    </Note>
  </Step>

  <Step title="워크플로 만들기 및 자격 증명 구성">
    1. 상단의 **+ New**를 클릭해 워크플로를 생성합니다.
    2. 캔버스에서 \*\*+\*\*를 클릭하고 **CometAPI**를 검색해 노드를 추가합니다.

    <Frame>
      <img src="https://mintcdn.com/cometapi/SZhlxZhCnMLn__BW/images/integrations/810968_360469.png?fit=max&auto=format&n=SZhlxZhCnMLn__BW&q=85&s=b47e1304ec3165720dd3ef37e1429485" alt="CometAPI 노드 검색이 열린 n8n 워크플로 캔버스" width="1235" height="899" data-path="images/integrations/810968_360469.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cometapi/SZhlxZhCnMLn__BW/images/integrations/810968_360472.png?fit=max&auto=format&n=SZhlxZhCnMLn__BW&q=85&s=b765a2d8024f4c5d36305916c440d02f" alt="n8n 캔버스에 추가된 CometAPI 노드" width="1724" height="854" data-path="images/integrations/810968_360472.png" />
    </Frame>

    3. **Manual Trigger** 노드를 추가하고 CometAPI 노드에 연결합니다.
    4. CometAPI 노드에서 **Credential to connect with** 아래의 **Create new**를 선택합니다. **CometAPI Key**에 CometAPI API 키를 붙여넣고 **Save**를 클릭합니다. Base URL은 기본값으로 `https://api.cometapi.com`이 설정되며, 일반적으로 변경할 필요가 없습니다.

    <Frame>
      <img src="https://mintcdn.com/cometapi/SZhlxZhCnMLn__BW/images/integrations/810968_360474.png?fit=max&auto=format&n=SZhlxZhCnMLn__BW&q=85&s=deee1c999cbfb2c432daaa53904d6b38" alt="API 키가 입력된 CometAPI 자격 증명 대화상자" width="1906" height="608" data-path="images/integrations/810968_360474.png" />
    </Frame>

    5. 노드를 구성합니다:

    * **Model**: 사용하려는 현재 model ID를 입력합니다
    * **Messages**: Role을 `user`로 설정하고, Content에 테스트 프롬프트(Prompt)(예: `Hello`)를 입력합니다
    * 선택 사항: `system` 메시지를 추가하고, **Max Tokens**, **Temperature** 등을 설정합니다

    6. **Execute step**을 클릭해 노드를 실행합니다. **Output** 패널에 JSON 응답이 표시됩니다.

    <Frame>
      <img src="https://mintcdn.com/cometapi/SZhlxZhCnMLn__BW/images/integrations/810968_360471.png?fit=max&auto=format&n=SZhlxZhCnMLn__BW&q=85&s=6953b97533f02e4f50cb1f0490ff057d" alt="성공적인 CometAPI JSON 응답이 표시된 n8n 출력 패널" width="2092" height="1762" data-path="images/integrations/810968_360471.png" />
    </Frame>
  </Step>
</Steps>

<AccordionGroup>
  <Accordion title="문제 해결">
    * **`node-gyp` 또는 네이티브 빌드 오류** — 빌드 도구를 설치하세요: `sudo apt install build-essential python3` (Debian/Ubuntu) 또는 Xcode Command Line Tools(macOS).
    * **npm 권한 오류(EACCES)** — 사용자 수준 Node.js 설치를 위해 nvm을 사용하세요. `sudo`는 필요하지 않습니다.
    * **포트 충돌(`localhost:5678` 사용 불가)** — `n8n start`를 실행하기 전에 `N8N_PORT=5679`(또는 다른 사용 가능한 포트)로 설정하세요.
    * **Community Nodes 섹션 누락** — **Owner** 계정으로 로그인하고 **Settings → Security**를 확인하세요.
    * **사내 네트워크에서 npm install 실패** — 프록시를 구성하세요: `npm config set proxy http://user:pass@host:port`
    * **CometAPI 노드가 401/403 반환** — API 키가 올바른지, 그리고 해당 model이 CometAPI 요금제에서 접근 가능한지 확인하세요.
    * **빈 응답 또는 토큰(Token) 제한 오류** — **Max Tokens**를 늘리세요. 필요에 따라 **Temperature**와 **Top P**를 조정하세요.
    * **터미널을 닫으면 n8n 중지됨** — pm2를 사용하세요: `pm2 start "n8n" --name n8n && pm2 save`.
  </Accordion>
</AccordionGroup>

<script type="application/ld+json">
  {`
    {
    "@context": "https://schema.org",
    "@graph": [
      {
        "@type": "HowTo",
        "@id": "https://apidoc.cometapi.com/integrations/n8n-local-deployment#howto",
        "name": "CometAPI와 함께 n8n을 로컬에서 실행하기",
        "description": "이 가이드를 사용하면 로컬 배포 설정, 자격 증명, model 접근 권한을 구성하여 CometAPI와 함께 n8n을 로컬에서 실행할 수 있습니다.",
        "step": [
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/n8n-local-deployment#step-1",
            "position": 1,
            "name": "CometAPI API 키 가져오기",
            "text": "CometAPI 계정을 만들거나 열고, 대시보드에서 활성 API 키를 복사합니다."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/n8n-local-deployment#step-2",
            "position": 2,
            "name": "nvm으로 Node.js 설치",
            "text": "CometAPI와 함께 n8n을 로컬에서 실행하기 가이드의 nvm으로 Node.js 설치 단계를 완료합니다."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/n8n-local-deployment#step-3",
            "position": 3,
            "name": "n8n 설치 및 시작",
            "text": "CometAPI와 함께 n8n을 로컬에서 실행하기 가이드의 n8n 설치 및 시작 단계를 완료합니다."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/n8n-local-deployment#step-4",
            "position": 4,
            "name": "Owner 계정 만들기",
            "text": "CometAPI와 함께 n8n을 로컬에서 실행하기 가이드의 Owner 계정 만들기 단계를 완료합니다."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/n8n-local-deployment#step-5",
            "position": 5,
            "name": "CometAPI 커뮤니티 노드 설치",
            "text": "CometAPI와 함께 n8n을 로컬에서 실행하기 가이드의 CometAPI 커뮤니티 노드 설치 단계를 완료합니다."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/n8n-local-deployment#step-6",
            "position": 6,
            "name": "워크플로 만들기 및 자격 증명 구성",
            "text": "CometAPI와 함께 n8n을 로컬에서 실행하기 가이드의 워크플로 만들기 및 자격 증명 구성 단계를 완료합니다."
          }
        ]
      },
      {
        "@type": "BreadcrumbList",
        "itemListElement": [
          {
            "@type": "ListItem",
            "position": 1,
            "name": "CometAPI 문서",
            "item": "https://apidoc.cometapi.com/"
          },
          {
            "@type": "ListItem",
            "position": 2,
            "name": "통합",
            "item": "https://apidoc.cometapi.com/integrations"
          },
          {
            "@type": "ListItem",
            "position": 3,
            "name": "CometAPI와 함께 n8n을 로컬에서 실행하기",
            "item": "https://apidoc.cometapi.com/integrations/n8n-local-deployment"
          }
        ]
      }
    ]
    }
    `}
</script>
