> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/deployment/ja/self-hosted/inference-server/install/windows.md).

# Windows にインストール

ネイティブインストーラーまたは Docker Desktop を使って、CPU、GPU、または TensorRT 上で Windows に Roboflow Inference Server をインストールします。

このページの Docker の例では、ポート 9001 を localhost に公開しています。別のマシン上のクライアントの場合は、意図的にマッピングを到達可能なホストアドレスに変更し、設定してください [サーバーアクセス](/deployment/ja/self-hosted/inference-server/configuration/security.md#restrict-network-access).

## Windows インストーラー (x86)

ネイティブのデスクトップアプリを使って、Windows マシン上で Roboflow Inference Server を実行できます。最新の GitHub リリースから最新の Windows インストーラーをダウンロードしてください: [GitHub で最新リリースを表示し、インストーラをダウンロード](https://github.com/roboflow/inference/releases).

1. [最新のインストーラーをダウンロード](https://github.com/roboflow/inference/releases) そして、それを実行して Roboflow Inference をインストールします。
2. インストールが完了すると、Inference Server を起動するかどうかを提案されます。
3. サーバーを停止するには、開いたターミナルウィンドウを閉じます。
4. 後で再度起動するには、 **Roboflow Inference** をスタートメニューで見つけます。

{% hint style="info" %}
**`inference-models` バックエンド。** 使用する場合、 `inference-models` バックエンドでは、シンボリックリンクを使ったキャッシュ管理のため、Inference Server を昇格した管理者権限で実行する必要があります。代替案として、 [開発者モード](https://learn.microsoft.com/en-us/windows/advanced-settings/developer-mode).

この `inference-models` バックエンドを有効化します。これは環境フラグでオプトインします: `$env:USE_INFERENCE_MODELS = "True"`.
{% endhint %}

## Docker を使用

まず、 [Docker Desktop をインストール](https://docs.docker.com/desktop/setup/install/windows-install/)。その後、CLI を使ってコンテナを起動します。

{% tabs %}
{% tab title="CPU" %}

```bash
pip install inference-cli
inference server start
```

{% endtab %}

{% tab title="GPU" %}
GPU を使用するには、最新の NVIDIA ドライバーと最新バージョンの WSL 2 がインストールされており、Docker で WSL 2 バックエンドが構成されていることを確認してください。 [Docker のセットアップ手順に従ってください](https://docs.docker.com/desktop/features/gpu/).

その後、CLI を使ってコンテナを起動します:

```bash
pip install inference-cli
inference server start
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
もし `pip install` コマンドが失敗する場合は、 [Python をインストールする](https://www.python.org/downloads/) 必要があるかもしれません。マシンに Python 3.12、3.11、または 3.10 が入ったら、もう一度コマンドを試してください。
{% endhint %}

## コンテナを手動で起動する

コンテナ設定をより細かく制御したい場合は、自分で起動してください。

{% tabs %}
{% tab title="CPU" %}
コアの CPU Docker イメージには、onnxruntime 経由で x64 CPU 上の OpenVINO アクセラレーションのサポートが含まれています。SAM2 のような重いモデルは実用的ではないほど遅く（画像1枚あたり数十秒）動作する場合があります。必要であれば、CUDA 対応 GPU を使用してください。

CPU 推論の主な用途は、静止画像の処理（たとえばアップロードされたものの NSFW 判定や文書検証）や、動画フレームの散発的なサンプリング（たとえば駐車場の占有状況の追跡）です。

CPU 推論を始めるには、 `roboflow/roboflow-inference-server-cpu:latest` コンテナを使用します。

```bash
docker run -d ^
    --name inference-server ^
    --read-only ^
    -p 127.0.0.1:9001:9001 ^
    --volume "%USERPROFILE%\.inference\cache:/tmp:rw" ^
    --security-opt="no-new-privileges" ^
    --cap-drop="ALL" ^
    --cap-add="NET_BIND_SERVICE" ^
    roboflow/roboflow-inference-server-cpu:latest
```

{% endtab %}

{% tab title="GPU" %}
GPU コンテナは、NVIDIA-Docker 経由で CUDA をサポートするカードにハードウェアアクセラレーションを追加します。 [GPU にアクセスするための Docker の設定が完了している](https://docs.docker.com/desktop/features/gpu/)ことを確認し、その後 `--gpus all` を `docker run` コマンドを追加します:

```bash
docker run -d ^
    --name inference-server ^
    --gpus all ^
    --read-only ^
    -p 127.0.0.1:9001:9001 ^
    --volume "%USERPROFILE%\.inference\cache:/tmp:rw" ^
    --security-opt="no-new-privileges" ^
    --cap-drop="ALL" ^
    --cap-add="NET_BIND_SERVICE" ^
    roboflow/roboflow-inference-server-gpu:latest
```

{% endtab %}

{% tab title="TensorRT" %}
GPU コンテナでは、必要に応じて [TensorRT](https://developer.nvidia.com/tensorrt)を有効にできます。これは NVIDIA のモデル最適化ランタイムです。各モデルを初めて読み込む際に重いコンパイルと最適化のステップ（場合によっては 15 分以上）が発生しますが、その代わりモデルの速度が大幅に向上します。

次を追加して TensorRT を有効にします。 `TensorrtExecutionProvider` を `ONNXRUNTIME_EXECUTION_PROVIDERS` 環境変数を有効にできます。

```bash
docker run -d ^
    --name inference-server ^
    --gpus all ^
    --read-only ^
    -p 127.0.0.1:9001:9001 ^
    --volume "%USERPROFILE%\.inference\cache:/tmp:rw" ^
    --security-opt="no-new-privileges" ^
    --cap-drop="ALL" ^
    --cap-add="NET_BIND_SERVICE" ^
    -e ONNXRUNTIME_EXECUTION_PROVIDERS="[TensorrtExecutionProvider,CUDAExecutionProvider,OpenVINOExecutionProvider,CPUExecutionProvider]" ^
    roboflow/roboflow-inference-server-gpu:latest
```

{% endtab %}
{% endtabs %}

## Docker Compose

アプリケーションで Docker Compose を使用している場合、同等の YAML は次のとおりです:

{% tabs %}
{% tab title="CPU" %}

```yaml
version: "3.9"

services:
  inference-server:
    container_name: inference-server
    image: roboflow/roboflow-inference-server-cpu:latest

    read_only: true
    ports:
      - "127.0.0.1:9001:9001"

    volumes:
      - "${USERPROFILE}/.inference/cache:/tmp:rw"

    security_opt:
      - no-new-privileges
    cap_drop:
      - ALL
    cap_add:
      - NET_BIND_SERVICE
```

{% endtab %}

{% tab title="GPU" %}

```yaml
version: "3.9"

services:
  inference-server:
    container_name: inference-server
    image: roboflow/roboflow-inference-server-gpu:latest

    read_only: true
    ports:
      - "127.0.0.1:9001:9001"

    volumes:
      - "${USERPROFILE}/.inference/cache:/tmp:rw"

    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]

    security_opt:
      - no-new-privileges
    cap_drop:
      - ALL
    cap_add:
      - NET_BIND_SERVICE
```

{% endtab %}

{% tab title="TensorRT" %}

```yaml
version: "3.9"

services:
  inference-server:
    container_name: inference-server
    image: roboflow/roboflow-inference-server-gpu:latest

    read_only: true
    ports:
      - "127.0.0.1:9001:9001"

    volumes:
      - "${USERPROFILE}/.inference/cache:/tmp:rw"

    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]

    environment:
      ONNXRUNTIME_EXECUTION_PROVIDERS: "[TensorrtExecutionProvider,CUDAExecutionProvider,OpenVINOExecutionProvider,CPUExecutionProvider]"

    security_opt:
      - no-new-privileges
    cap_drop:
      - ALL
    cap_add:
      - NET_BIND_SERVICE
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Roboflow Enterprise プランには [Kubernetes デプロイメント用の Helm チャート](https://github.com/roboflow/inference/tree/main/inference/enterprise/helm-chart) Kubernetes デプロイメント、OT ネットワーク向けのネットワーキングソリューション、カスタマイズされたサポートおよびインストールパッケージ向けです。 [営業チームにお問い合わせください](https://roboflow.com/sales) 詳細をご確認ください。
{% endhint %}

## 次の手順

* [モデルを実行する](/deployment/ja/self-hosted/self-hosted.md#run-model-locally) 新しいサーバーに対して。
* [インストール `inference-gpu` Windows 上のベアメタル](/deployment/ja/self-hosted/inference-library/bare-metal-gpu-windows.md) Docker を使用できない場合は。
* [セルフホストサーバーの保護](/deployment/ja/self-hosted/inference-server/configuration/security.md) localhost の外に公開する前に。
