Files
n8n-guide/docs/installation/local-deployment.md
2025-09-11 14:00:33 +08:00

78 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 本地/私有化部署
对于需要数据隐私控制、内网集成或大规模使用的场景,本地部署是最佳选择。
## 🚀 最简单的部署方式
### Docker部署推荐
**前置要求**安装Docker和Docker Compose
**一键部署**
```bash
# 创建目录
mkdir n8n && cd n8n
# 下载配置文件
curl -o docker-compose.yml https://raw.githubusercontent.com/n8n-io/n8n/master/docker/compose/withPostgres/docker-compose.yml
# 启动服务
docker-compose up -d
# 访问 http://localhost:5678
```
### npm安装开发者
**前置要求**Node.js 18.10+
```bash
# 全局安装n8n
npm install n8n -g
# 启动n8n
n8n start
# 访问 http://localhost:5678
```
## 📚 学习资源
- **图文教程**[n8n本地部署详解](https://blog.csdn.net/2501_90561511/article/details/147479401)
- **视频教程**[n8n Docker部署实战](https://www.bilibili.com/video/BV1kZNrzpEy6)
- **官方文档**[n8n Self-hosting](https://docs.n8n.io/hosting/)
## 🔧 基础配置
### 重要配置说明
**Volume映射配置**
- **数据存储**`/home/node/.n8n` - 存储工作流和凭证
- **文件访问**`/files` - 工作流读写本地文件
![Docker 配置界面](../assets/images/配置画面.png)
**基础环境变量**
```bash
GENERIC_TIMEZONE=Asia/Shanghai
N8N_BASIC_AUTH_ACTIVE=true
N8N_BASIC_AUTH_USER=admin
N8N_BASIC_AUTH_PASSWORD=your-secure-password
```
## 🏭 生产环境部署
对于生产环境部署,需要更详细的配置和安全设置。请参考:[生产环境部署指南](production-deployment.md)
## 📚 相关资源
- **图文教程**[n8n本地部署详解](https://blog.csdn.net/2501_90561511/article/details/147479401)
- **视频教程**[n8n Docker部署实战](https://www.bilibili.com/video/BV1kZNrzpEy6)
- **官方文档**[n8n Self-hosting](https://docs.n8n.io/hosting/)
---
现在您已经成功部署了n8n接下来可以开始配置界面和创建第一个工作流。
[上一章:快速开始](quick-start/){ .md-button } [下一章:界面介绍](interface/){ .md-button .md-button--primary }