---
title: nexcmpコマンドリファレンス
description: nexcmpサーバーコマンドラインツールの各サブコマンド（status、update、backup、uninstall、open-port、close-port、fix-owner）について説明します。
url: https://nexcmp.com/ja/docs/getting-started/cli-reference/
applies_to: NexCMP 1.6.1
updated: 2026-11-02
---

# `nexcmp` コマンドリファレンス {#nexcmp-command-reference}

インストーラーはヘルパーを `/usr/local/bin/nexcmp` に配置します。NexCMPサーバー上で実行してください。システムを変更するコマンドには `sudo` が必要です（API用のカスタマーサイドのツールは別のプログラムです。 [cmp CLI](https://nexcmp.com/ja/docs/developers/cmp-cli/) を参照してください）。

| コマンド | root権限の必要性 | 動作内容 |
|---|---|---|
| `nexcmp status` | いいえ（`sudo` で詳細を確認可能） | バージョン、サービスのステータス（`nexcmp`、`nexcmp-vmd`）、`/healthz`、ライセンスの概要、パブリックポートの状態、ウィザードが未完了の場合はセットアップコード |
| `nexcmp update` | はい | 保存されたパラメータを使用して、インストール済みのリリースに同梱されているインストーラーを実行します — [アップデート](https://nexcmp.com/ja/docs/getting-started/updating/) を参照 |
| `nexcmp backup [dir]` | はい | `/var/backups/nexcmp`（または `dir`）へのバックアップ — [Backup and restore](https://nexcmp.com/ja/docs/getting-started/backup-and-restore/) を参照 |
| `nexcmp uninstall [--purge]` | はい | サービスとプログラムの削除。`--purge`はデータも削除します — [Uninstall](https://nexcmp.com/ja/docs/getting-started/uninstall/) を参照 |
| `nexcmp open-port [minutes]` | はい | **緊急**: すべてのインターフェイス上のパネルポート（デフォルト 3000）で 1〜1440 分間（デフォルト 30）リクエストを待ち受け、その後自動的に閉じます |
| `nexcmp close-port` | はい | 今すぐ緊急ウィンドウを閉じる |
| `nexcmp fix-owner` | はい | `/var/lib/nexcmp` 内の root 所有のファイルを `nexcmp` ユーザーに戻す |

## `nexcmp status`

```text
Version   : 1.6.1
nexcmp     : active
nexcmp-vmd : active
healthz    : ok
License   : active · domain cloud.example.com · token valid until 2026-11-12 · updates until 2027-10-30
Public port: 127.0.0.1 only (nginx proxy; emergency: sudo nexcmp open-port)
```

データディレクトリ内のファイルが root 所有である場合（別の `nexcmp` コマンドを `sudo` として root で実行した場合など）、サービスユーザーが読み取れないため `status` は警告を出力します。典型的な症状としてライセンスが HTTP 421 を返します。`sudo nexcmp fix-owner` で修復してください。同じ修復がサービスの起動ごとに自動実行されます。

## 緊急アクセス {#emergency-access}

ドメイン、nginx、または TLS が動作しない場合でも、パネルにアクセスできます:

```bash
sudo nexcmp open-port 30          # http://<server-IP>:3000/ for 30 minutes
sudo nexcmp close-port            # close it earlier
```

より安全で何も開かない方法: `ssh -L 3000:127.0.0.1:3000 user@server` を実行して `http://127.0.0.1:3000/` をブラウズします。

## 環境変数 {#environment}

| 変数 | 用途 |
|---|---|
| `NEXCMP_BASE` | ライセンスサーバーのベース URL を上書きします（デフォルト `https://nexcmp.com`）。テスト専用です |

ファイルとディレクトリ: プログラム `/opt/nexcmp`、設定 `/etc/nexcmp`、データ `/var/lib/nexcmp`、ログ `/var/log/nexcmp` および `journalctl -u nexcmp -u nexcmp-vmd`。
