> For the complete documentation index, see [llms.txt](https://developer.mixeder.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.mixeder.net/api-reference/s3-apidenoakusesu.md).

# S3 APIでのアクセス

Mini-VPS オブジェクトストレージ（S3互換）への接続マニュアルを作成しました。

ユーザーに配布するドキュメントとして、あるいはWebサイトのヘルプページとしてご利用ください。

***

## Mini-VPS オブジェクトストレージ 接続マニュアル

Mini-VPSのオブジェクトストレージは S3互換プロトコル をサポートしています。

Cyberduck、WinSCP、AWS CLIなどの一般的なツールや、各種プログラミング言語のAWS SDKを使用して、ファイルのアップロードや管理が可能です。

### 📋 事前準備

接続には以下の情報が必要です。管理画面の「Storage」メニューから取得してください。

| **項目**            | **説明**       |
| ----------------- | ------------ |
| Access Key ID     | 発行したAPIキー    |
| Secret Access Key | 発行したシークレットキー |
| バケット名             | 作成したバケットの名前  |

### ⚙️ 基本接続設定 (共通)

どのツールを使用する場合でも、基本となる設定値は以下の通りです。

* 接続タイプ: S3 Compatible (S3互換) / HTTPS
* サーバー (Endpoint): `mini-vps.mixeder.com`
* ポート: `443`
* リージョン: `auto` (または `us-east-1`)
* パススタイル (Path Style): 有効 (ON) ※非常に重要

***

### 🦆 Cyberduck での接続方法 (Mac / Windows)

Cyberduckは設定が簡単で推奨されるクライアントです。

1. 「新規接続 (Open Connection)」 をクリックします。
2. 最上部のプロファイル選択リストから 「S3 (HTTPS)」 を選択してください。
   * ⚠️ 注意: 「Amazon S3」は選択しないでください。接続エラーになります。
3. 以下の通りに入力します。
   * Server: `mini-vps.mixeder.com`
   * Port: `443`
   * Access Key ID: (あなたのAPIキー)
   * Secret Access Key: (あなたのシークレットキー)
4. 「詳細設定 (More Options)」 を開き、Path (パス) が 空欄 であることを確認します。
   * ※もし `/api/...` などが入っている場合はすべて削除してください。
5. 「接続 (Connect)」 をクリックします。

<figure><img src="/files/y2zyfbZrAV993Fd3YKyj" alt=""><figcaption></figcaption></figure>

***

### 📂 WinSCP での接続方法 (Windows)

WinSCPを使用する場合は、詳細設定でバケット名を指定する必要があります。

1. 「新しいセッション」 画面を開きます。
2. 以下の通りに入力します。
   * 転送プロトコル: `Amazon S3`
   * ホスト名: `mini-vps.mixeder.com`
   * ポート番号: `443`
   * アクセスキーID: (あなたのAPIキー)
   * シークレットキー: (あなたのシークレットキー)
3. 「設定 (Advanced)...」 ボタンをクリックします。
4. 左メニューの 「環境 (Environment)」 > 「ディレクトリ (Directories)」 を選択します。
5. 「リモートディレクトリ (Remote directory)」 に `/あなたのバケット名` と入力します。
   * 例: バケット名が `my-app` なら `/my-app` と入力。
6. 「OK」を押して設定を閉じ、「ログイン」 をクリックします。

***

### 💻 AWS CLI での接続方法

コマンドラインから操作する場合の設定例です。

1\. プロファイルの設定

`~/.aws/credentials` に以下を追記します。

Ini, TOML

```
[minivps]
aws_access_key_id = (あなたのAPIキー)
aws_secret_access_key = (あなたのシークレットキー)
```

2\. コマンドの実行

必ず `--endpoint-url` オプションを指定してください。

Bash

```
# バケット内のファイル一覧を表示
aws s3 ls s3://(バケット名)/ --endpoint-url https://mini-vps.mixeder.com --profile minivps

# ファイルをアップロード
aws s3 cp test.txt s3://(バケット名)/ --endpoint-url https://mini-vps.mixeder.com --profile minivps
```

***

### 🐘 PHP (AWS SDK) での実装例

PHPからアクセスする場合、`use_path_style_endpoint` を `true` に設定するのがポイントです。

PHP

```
require 'vendor/autoload.php';

use Aws\S3\S3Client;

$s3 = new S3Client([
    'version' => 'latest',
    'region'  => 'auto',
    'endpoint' => 'https://mini-vps.mixeder.com',
    'use_path_style_endpoint' => true, // 【重要】これが必要です
    'credentials' => [
        'key'    => 'あなたのAPIキー',
        'secret' => 'あなたのシークレットキー',
    ],
]);

// ファイルアップロード
$s3->putObject([
    'Bucket' => 'あなたのバケット名',
    'Key'    => 'folder/image.png',
    'SourceFile' => './image.png',
]);
```

***

### ❓ よくある質問とトラブルシューティング

Q. "Access Denied" と表示される

A. APIキーまたはシークレットキーが間違っている可能性があります。また、APIキーはそのキーを発行したバケットに対してのみ有効です。別のバケットにアクセスしようとしていないか確認してください。

Q. フォルダが削除できない

A. フォルダの中にファイルが残っていると削除できない場合があります。中身を空にしてから削除してください。また、クライアントソフトによっては表示上のラグがあるため、一度「更新（リロード）」を行ってください。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.mixeder.net/api-reference/s3-apidenoakusesu.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
