Ticker

6/recent/ticker-posts

Header Ads Widget

كيفية عمل سيرفر N8N مدى الحياة بشكل مجاني

```html دليل تثبيت n8n على خادم Google Cloud المجاني | n8n on Google Cloud Free Tier

دليلك الكامل لتثبيت n8n على خادم Google Cloud المجاني

أطلق العنان لقوة الأتمتة بنفسك، مجانًا وبدون حدود!

n8n هي أداة أتمتة مفتوحة المصدر وقوية جدًا، تعتبر بديلاً ممتازًا لخدمات مثل Zapier وMake. في هذا الدليل، سنوضح لك خطوة بخطوة كيفية تثبيتها على الفئة المجانية الدائمة من Google Cloud، لتحصل على منصة أتمتة خاصة بك ومجانية مدى الحياة.

1 إنشاء حساب Google Cloud وتفعيله

الخطوة الأولى هي تجهيز بيئة العمل على Google Cloud.

  • اذهب إلى Google Cloud وأنشئ حسابًا.
  • استفد من الرصيد المجاني (عادةً 300$ لمدة 90 يومًا) لتجربة الخدمات.
  • بعد انتهاء الرصيد، سيبقى لديك الخادم المجاني من نوع e2-micro ضمن الفئة المجانية الدائمة.

2 إنشاء خادم افتراضي (VM Instance)

سنقوم الآن بإنشاء الخادم الصغير الذي سيستضيف n8n.

  • من لوحة التحكم، اذهب إلى Compute Engine → VM Instances ثم اضغط Create Instance.
  • نوع الجهاز (Machine type): اختر e2-micro، فهو ضمن الفئة المجانية.
  • نظام التشغيل (Boot disk): اختر Ubuntu 22.04 LTS.
  • جدار الحماية (Firewall): ضع علامة صح على Allow HTTP traffic و Allow HTTPS traffic.

3 الاتصال بالخادم وتثبيت Docker

Docker هو ما سيسمح لنا بتشغيل n8n بسهولة. اتصل بخادمك عبر نافذة SSH المدمجة في Google Cloud ونفّذ الأوامر التالية لتحديث النظام وتثبيت Docker.

sudo apt update && sudo apt upgrade -y
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER

مهم: بعد تنفيذ الأمر الأخير، سجّل الخروج من جلسة SSH وأعد الدخول مرة أخرى لتفعيل الصلاحيات الجديدة.

4 إنشاء مجلد وتشغيل n8n

سنقوم بإعداد ملف الإعدادات وتشغيل حاوية n8n.

1. أنشئ مجلدًا للمشروع وانتقل إليه:

mkdir n8n && cd n8n

2. أنشئ ملف docker-compose.yml باستخدام محرر النصوص nano:

nano docker-compose.yml

3. الصق المحتوى التالي بداخله. لا تنسَ تغيير كلمة_مرور_قوية إلى كلمة مرور حقيقية من اختيارك!

تنبيه: استبدل كلمة_مرور_قوية بكلمة مرور معقدة وآمنة.
version: '3.8'
services:
  n8n:
    image: n8nio/n8n:latest
    restart: always
    ports:
      - "5678:5678"
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=كلمة_مرور_قوية
    volumes:
      - n8n_data:/home/node/.n8n

volumes:
  n8n_data:

لحفظ الملف والخروج من nano: اضغط Ctrl+X، ثم Y، ثم Enter.

4. شغّل الحاوية في الخلفية:

docker compose up -d

5 فتح منفذ 5678 في جدار الحماية

يعمل n8n على المنفذ 5678، لكن جدار حماية Google Cloud يمنع الوصول إليه افتراضيًا. يجب أن نسمح بذلك.

  • من لوحة التحكم، اذهب إلى VPC Network → Firewall.
  • اضغط Create Firewall Rule.
  • Name: سمّها أي اسم (مثلاً n8n-access).
  • Targets: اختر All instances in the network.
  • Source IPv4 ranges: اكتب 0.0.0.0/0 للسماح بالوصول من أي مكان.
  • Protocols and ports: اختر Specified protocols and ports، ثم ضع علامة على TCP واكتب 5678.
  • اضغط Create.

6 الوصول إلى لوحة تحكم n8n

تهانينا! كل شيء جاهز الآن. للوصول إلى لوحة التحكم:

  • احصل على عنوان IP الخارجي لخادمك من صفحة VM Instances.
  • افتح متصفحك واكتب العنوان التالي: http://<عنوان_الخادم_الخارجي>:5678
  • سجّل الدخول باستخدام اسم المستخدم (admin) وكلمة المرور التي حددتها في ملف docker-compose.yml.

الآن أصبحت تملك منصة الأتمتة الخاصة بك، استمتع ببناء سير العمل وتوفير وقتك!

n8n is a powerful open-source automation tool, an excellent self-hosted alternative to services like Zapier and Make. In this guide, we'll walk you through setting it up on Google Cloud's always-free tier, giving you your own private, lifelong free automation platform.

1 Create & Activate Google Cloud Account

First, let's prepare the environment on Google Cloud.

  • Go to Google Cloud and sign up.
  • Take advantage of the free credit (usually $300 for 90 days) to explore the services.
  • After the credit expires, you will still have access to the e2-micro instance as part of the always-free tier.

2 Create a VM Instance

Now, we will create the small server that will host n8n.

  • From the console, navigate to Compute Engine → VM Instances and click Create Instance.
  • Machine type: Select e2-micro, as it's part of the free tier.
  • Boot disk: Choose Ubuntu 22.04 LTS.
  • Firewall: Check the boxes for Allow HTTP traffic and Allow HTTPS traffic.

3 Connect to the Server & Install Docker

Docker will allow us to run n8n easily. Connect to your instance via the SSH button in the Google Cloud console and run the following commands to update the system and install Docker.

sudo apt update && sudo apt upgrade -y
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER

Important: After running the last command, log out of the SSH session and log back in to apply the new permissions.

4 Create a Directory & Run n8n

Let's set up the configuration file and run the n8n container.

1. Create a project directory and navigate into it:

mkdir n8n && cd n8n

2. Create a docker-compose.yml file using the nano text editor:

nano docker-compose.yml

3. Paste the following content inside. Don't forget to change Your_Strong_Password_Here to a real password of your choice!

Alert: Replace Your_Strong_Password_Here with a complex and secure password.
version: '3.8'
services:
  n8n:
    image: n8nio/n8n:latest
    restart: always
    ports:
      - "5678:5678"
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=Your_Strong_Password_Here
    volumes:
      - n8n_data:/home/node/.n8n

volumes:
  n8n_data:

To save the file and exit nano: Press Ctrl+X, then Y, then Enter.

4. Start the container in the background:

docker compose up -d

5 Open Port 5678 in the Firewall

n8n runs on port 5678, but the Google Cloud firewall blocks it by default. We need to create a rule to allow access.

  • From the console, navigate to VPC Network → Firewall.
  • Click Create Firewall Rule.
  • Name: Give it a name (e.g., n8n-access).
  • Targets: Select All instances in the network.
  • Source IPv4 ranges: Enter 0.0.0.0/0 to allow access from anywhere.
  • Protocols and ports: Select Specified protocols and ports, then check TCP and enter 5678.
  • Click Create.

6 Access Your n8n Dashboard

Congratulations! Everything is now ready. To access your dashboard:

  • Get your server's External IP address from the VM Instances page.
  • Open your browser and navigate to the following URL: http://<YOUR_SERVER_IP>:5678
  • Log in with the username (admin) and the password you set in the docker-compose.yml file.

You now own your private automation platform. Enjoy building workflows and saving time!

```

Post a Comment

0 Comments