Files
3x-ui/docs/content/docs/zh/reference/ports-firewall.mdx
T
MHSanaei 9b91f0f42e docs: vendor the documentation site into the monorepo
Fold the standalone 3x-ui-docs project (Next.js 16 + Fumadocs, deployed to
docs.sanaei.dev) into docs/ so the panel and its documentation share a single
source of truth, the way sing-box keeps its docs in-tree. The old repo becomes
redundant and can be retired.

- Import the full site under docs/ (app, components, content, lib, public,
  scripts, config). The self-contained pnpm project sits alongside the existing
  engineering notes with no filename collisions.
- Re-point "Edit on GitHub" links from MHSanaei/3x-ui-docs to this repo's
  docs/content/docs path (docs/lib/shared.ts, docs/app/.../page.tsx).
- Add docs-ci.yml and docs-deploy.yml under .github/workflows/, scoped to
  docs/** and run with working-directory: docs, since GitHub only runs
  workflows from the repo-root .github/. deploy-static.yml's GitHub Pages
  publish (CNAME docs.sanaei.dev) carries over unchanged.

Follow-up (outside this commit): attach the docs.sanaei.dev custom domain to
this repository's Pages (or set the Vercel project's root directory to docs),
confirm the site is live from the monorepo, then delete MHSanaei/3x-ui-docs.
2026-07-07 23:07:14 +02:00

36 lines
1.3 KiB
Plaintext

---
title: 端口与防火墙
description: 3x-ui 默认使用的端口,以及用于开放这些端口的现成 ufw / nftables 规则。
icon: Network
---
只开放你实际会用到的端口。下面列出了常用端口,并提供了一个用于生成
`ufw` 和 `nftables` 规则的生成器。
## 常用端口
| Port (default) | Purpose |
| -------------- | ----------------------------------------- |
| `22` | SSH(务必保持开放!)。 |
| `2053` | 面板(可配置)。 |
| `2096` | 订阅服务器(如果单独部署)。 |
| `443` | 常用的入站端口(TLS / REALITY)。 |
| `80` / `443` | 反向代理(如果你运行了反向代理)。 |
实际的入站端口取决于你创建的入站配置。
## 生成防火墙规则
<FirewallRulesGenerator />
<Callout type="warn">
在启用默认拒绝策略之前,请始终保持 SSH 处于允许状态,并在另一个会话中进行测试,以免把自己锁在外面。
</Callout>
## 相关内容
<Cards>
<Card title="安全" href="/docs/operations/security" description="Fail2ban、IP 限制与安全加固。" />
<Card title="环境变量" href="/docs/reference/env-vars" description="XUI_PORT 及相关变量。" />
</Cards>