🚀 ติดตั้ง n8n ฟรี 100% | วิธีทำ Self-Host แบบมีฐานข้อมูล ไม่ต้องใช้บัตรเครดิต 2025
Table of Contents
Introduction
This tutorial will guide you through the process of setting up n8n, a low-code workflow automation platform, using Docker Compose. You can self-host n8n for free without needing a credit card or worrying about time limitations associated with cloud versions. This setup will connect various applications like Google Sheets and Gmail, enhancing your productivity significantly.
Step 1: Prepare Your Environment
Before installing n8n, ensure your system is ready.
- Check Requirements: Confirm that your system supports Docker. You will need a compatible operating system such as Windows, macOS, or a Linux distribution.
- Install Docker and Docker Compose:
- For Windows and macOS, download Docker Desktop from the Docker website.
- For Linux, install Docker and Docker Compose using your package manager. For example, on Ubuntu:
sudo apt-get update sudo apt-get install docker.io docker-compose
- Verify the installation:
docker --version docker-compose --version
Step 2: Create Your Docker Compose File
Next, you will create a docker-compose.yml
file to define your n8n setup.
- Create a New Directory:
mkdir n8n && cd n8n
- Create the
docker-compose.yml
File:- Use a text editor to create the file:
nano docker-compose.yml
- Add the following content to the file:
version: '3' services: n8n: image: n8nio/n8n ports: - "5678:5678" environment: - N8N_HOST=localhost - N8N_PORT=5678 - DB_TYPE=sqlite - DB_SQLITE_DATABASE=/data/database.sqlite volumes: - ./data:/data
- Save and exit the editor.
- Use a text editor to create the file:
Step 3: Start n8n
Now that your docker-compose.yml
file is ready, you can run n8n.
- Run Docker Compose:
docker-compose up -d
- Access n8n:
- Open your web browser and go to
http://localhost:5678
.
- Open your web browser and go to
Step 4: Update n8n and Preserve Data
Maintaining your n8n installation is crucial for performance.
- Update n8n:
- Stop the running container:
docker-compose down
- Pull the latest image:
docker-compose pull
- Restart n8n:
docker-compose up -d
- Stop the running container:
- Data Preservation:
- Ensure your
docker-compose.yml
file uses volumes to store data persistently. This way, your workflows and settings remain intact through updates.
- Ensure your
Conclusion
You have successfully installed n8n using Docker Compose, allowing you to automate workflows without incurring costs or limitations. To further enhance your skills, consider exploring advanced integrations and functionalities within n8n. Don’t forget to visit the provided links for resources and a complete course on AI automation!