---
title: nexcmp command reference
description: คำสั่งย่อยทั้งหมดของเครื่องมือบรรทัดคำสั่งเซิร์ฟเวอร์ nexcmp — status, update, backup, uninstall, open-port, close-port และ fix-owner
url: https://nexcmp.com/th/docs/getting-started/cli-reference/
applies_to: NexCMP 1.6.1
updated: 2026-11-02
---

# `nexcmp` command reference {#nexcmp-command-reference}

ตัวติดตั้งจะวางโปรแกรมเสริมไว้ที่ `/usr/local/bin/nexcmp` โปรดเรียกใช้งานบนเซิร์ฟเวอร์ NexCMP คำสั่งที่เปลี่ยนแปลงระบบจำเป็นต้องใช้สิทธิ์ `sudo` (เครื่องมือฝั่งลูกค้าสำหรับ API เป็นโปรแกรมแยกต่างหาก โปรดดูที่ [cmp CLI](https://nexcmp.com/th/docs/developers/cmp-cli/))

| Command | Needs root | What it does |
|---|---|---|
| `nexcmp status` | No (ดูรายละเอียดเพิ่มเติมที่ `sudo`) | เวอร์ชัน, สถานะของบริการ (`nexcmp`, `nexcmp-vmd`), `/healthz`, สรุปใบอนุญาต, สถานะพอร์ตสาธารณะ, รหัสติดตั้งหากตัวช่วยตั้งค่า (wizard) ยังไม่เสร็จสิ้น |
| `nexcmp update` | ใช่ | รันตัวติดตั้งที่มาพร้อมกับรีลีสที่ติดตั้งไว้พร้อมพารามิเตอร์ที่บันทึก — ดูที่ [Updating](https://nexcmp.com/th/docs/getting-started/updating/) |
| `nexcmp backup [dir]` | ใช่ | สำรองข้อมูลไปยัง `/var/backups/nexcmp` (หรือ `dir`) — ดู [Backup and restore](https://nexcmp.com/th/docs/getting-started/backup-and-restore/) |
| `nexcmp uninstall [--purge]` | ใช่ | ลบบริการและโปรแกรม `--purge` จะลบข้อมูลด้วยเช่นกัน — ดู [Uninstall](https://nexcmp.com/th/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`
