> 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/raspberry-pi.md).

# Raspberry Pi にインストール

Docker を使って 64 ビットの Raspberry Pi 4 または 5 に Roboflow Inference Server をインストールし、期待できる性能を説明します。

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

Inference は、次を使用すれば Raspberry Pi 4 Model B および Raspberry Pi 5 で動作します。 [オペレーティングシステムの64ビット版](https://www.raspberrypi.com/software/operating-systems/)。SDカードに十分な空き容量がある場合は、64ビット版の「デスクトップと推奨ソフトウェアを含む Raspberry Pi OS」をおすすめします。

64ビット版OSをインストールしたら、 [Dockerをインストールし](https://docs.docker.com/engine/install/debian/)、Inference CLIを使って適切なInference Dockerコンテナを自動的に選択、設定、起動します。

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

{% hint style="warning" %}
**デフォルトでは、このデバイスからのみサーバーにアクセスできます。** `inference server start` ポート `9001` を `127.0.0.1`で公開するため、同じネットワーク上のノートパソコンや別のホストからのリクエストは拒否されます。LAN経由でアクセスするには、次のコマンドで起動します。 `inference server start --bind-address 0.0.0.0` （または、コンテナのポートを次のように公開します。 `-p 0.0.0.0:9001:9001`）。ただし、まず [セルフホストサーバーのセキュリティ保護](https://docs.roboflow.com/deployment/ja/self-hosted/inference-server/configuration/security.md) をお読みください。デフォルトではサーバーに認証機能がなく、WorkflowsのカスタムPythonブロックを実行するためです。
{% endhint %}

## ハードウェアアクセラレーション

Inferenceは、現時点ではRaspberry Piでのハードウェアアクセラレーションをサポートしていません。「Roboflow 3.0 Fast」物体検出モデル（「nano」サイズのYOLOモデル相当）では、Pi 4で約1 FPS、Pi 5で約4 FPSです。

Segment Anythingのような大型モデルや、Florence-2のようなVLMは、Piの計算能力では処理が困難です。より高いフレームレートや大型モデルが必要な場合は、 [NVIDIA Jetson](https://docs.roboflow.com/deployment/ja/self-hosted/inference-server/install/jetson.md).

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

コンテナ設定をより細かく制御したい場合は、手動で起動します。

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

## Docker Compose

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

```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:
      - "${HOME}/.inference/cache:/tmp:rw"

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

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

## 次のステップ

* [モデルを実行](https://docs.roboflow.com/deployment/ja/self-hosted/self-hosted.md#run-model-locally) して、新しいサーバーで推論を行います。
* [Docker の設定オプション](https://docs.roboflow.com/deployment/ja/self-hosted/inference-server/configuration/docker-configuration.md) ポート、キャッシュ、モデルの上限について。
* [セルフホスト型サーバーを保護](https://docs.roboflow.com/deployment/ja/self-hosted/inference-server/configuration/security.md) してから、localhost以外に公開してください。
