> 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/serufuhosuto/inference-server/install/mac.md).

# Mac にインストール

## macOSネイティブアプリ（Apple Silicon）

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

1. [Roboflow InferenceのDMGをダウンロード](https://github.com/roboflow/inference/releases) ディスクイメージ。
2. ディスクイメージをダブルクリックしてマウントします。
3. Roboflow Inferenceアプリを「アプリケーション」フォルダへドラッグします。
4. 「アプリケーション」フォルダを開き、Roboflow Inferenceアプリをダブルクリックしてサーバーを起動します。

## Dockerを使用する

{% tabs %}
{% tab title="CPU" %}
まず、 [Docker Desktopをインストールし](https://docs.docker.com/desktop/setup/install/mac-install/)。その後、CLIを使ってコンテナを起動します:

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

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

```bash
sudo docker run -d \\
    --name inference-server \\
    --read-only \\
    -p 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
```

{% endtab %}

{% tab title="GPU（MPS）" %}
Appleはまだ [Metal Performance Shaders（MPS）デバイスをDockerに渡すことをサポートしていません](https://github.com/pytorch/pytorch/issues/81224)。そのため、Mac上のコンテナ内ではハードウェアアクセラレーションは利用できません。MPSを使うには、Dockerの外でサーバーを実行する必要があります。

{% hint style="success" %}
まずはCPU版のDockerイメージで始め、より速度が必要になったら後からMPSアクセラレーション付きでDockerの外で実行するよう切り替えるのが最も簡単です。
{% endhint %}

推奨するのは [`pyenv`](https://github.com/pyenv/pyenv) および [`pyenv-virtualenv`](https://github.com/pyenv/pyenv-virtualenv) で、Mac上のPython環境を管理することです。特に [homebrew](https://brew.sh) はデフォルトでPython 3.13を使用しますが、これはInferenceが使用するいくつかの機械学習依存関係とまだ互換性がありません。

をインストールして設定したら `pyenv` および `pyenv-virtualenv` （シェルのセットアップについては完全な手順に従ってください）、 `推論` Python 3.12の仮想環境を作成して有効化します:

```bash
pyenv install 3.12
pyenv virtualenv 3.12 inference
pyenv activate inference
```

Dockerの外でサーバーをインストールして実行するには、リポジトリをクローンし、依存関係をインストールし、 `cpu_http.py` をリポジトリのトップレベルにコピーして、 `uvicorn`:

```bash
git clone https://github.com/roboflow/inference.git
cd inference
pip install .
cp docker/config/cpu_http.py .
uvicorn cpu_http:app --port 9001 --host 0.0.0.0
```

これでサーバーは次のアドレスで実行されています `http://localhost:9001` MPSアクセラレーション付きで。
{% endtab %}
{% endtabs %}

## 次の手順

* [モデルを実行する](/deployment/ja/serufuhosuto/self-hosted.md#run-a-model) 新しいサーバーに対して。
* [Dockerの設定オプション](/deployment/ja/serufuhosuto/inference-server/configuration/docker-configuration.md) ポート、キャッシュ、モデル制限用の。
* [セルフホスト型サーバーのセキュリティ保護](/deployment/ja/serufuhosuto/inference-server/configuration/security.md) localhost の外部に公開する前に。
