APFlow All field notesكل الملاحظات
Book a callاحجز مكالمة
Deploymentالنشر DockerDocker Guideدليل

Deploying agents on a server, the simple wayنشر الوكلاء على خادم، بالطريقة البسيطة

Your agent works on your laptop. Now it needs to run on a server, all day, and survive restarts. One tool matters most: Docker. This guide explains it in plain words and ships a full agent stack with one command.وكيلك يعمل على حاسوبك. الآن يجب أن يعمل على خادم، طوال اليوم، وينجو من إعادة التشغيل. أداة واحدة هي الأهم: Docker. هذا الدليل يشرحها بكلمات بسيطة وينشر منظومة وكلاء كاملة بأمر واحد.

APFlow
Field notesملاحظات ميدانية · June 2026يونيو ٢٠٢٦ · 8 min read٨ دقائق
Shipping containers from above, neatly stacked
Photo: Logan Voss, Unsplash
TL;DR
  • ·Docker packages your agent with everything it needs into a container: it runs the same on your laptop and on the server. This is the single most important deployment tool.Docker يغلف وكيلك مع كل ما يحتاجه في حاوية واحدة: يعمل بالشكل نفسه على حاسوبك وعلى الخادم. هذه أهم أداة نشر على الإطلاق.
  • ·Docker Compose describes your whole stack (model server, workflow engine, database) in one file, and `docker compose up -d` starts everything.Docker Compose يصف منظومتك كاملة (خادم النماذج ومحرك المسارات وقاعدة البيانات) في ملف واحد، وأمر واحد يشغل كل شيء.
  • ·Not a terminal person? Portainer gives you a visual dashboard over Docker: start, stop, and inspect everything from the browser.لا تحب الطرفية؟ Portainer يعطيك لوحة مرئية فوق Docker: شغل وأوقف وراقب كل شيء من المتصفح.

An agent that runs on your laptop is a demo. An agent that runs on a server, restarts itself after a crash, and keeps working while you sleep is a system. The gap between the two is deployment, and in 2026 the path is far simpler than it looks: almost everything reduces to Docker plus one configuration file. This guide keeps it that simple.الوكيل الذي يعمل على حاسوبك عرض تجريبي. والوكيل الذي يعمل على خادم، ويعيد تشغيل نفسه بعد العطل، ويواصل العمل وأنت نائم، هو نظام. الفرق بينهما هو النشر، وفي 2026 الطريق أبسط بكثير مما يبدو: كل شيء تقريباً يختصر في Docker وملف إعداد واحد. هذا الدليل يبقيه بهذه البساطة.

Why Docker is the one tool that mattersلماذا Docker هو الأداة الأهم

The oldest problem in software is "it works on my machine". Your agent needs Python 3.12, four libraries, a model server, and a database, and the server has none of them. Docker solves this by packaging the application and everything it needs into a container: a sealed box that runs identically anywhere Docker is installed. You build the box once; the server just runs it. That is the entire idea, and it is why Docker is the default skill to learn before any other deployment tool.أقدم مشكلة في البرمجيات هي "يعمل على جهازي أنا". وكيلك يحتاج Python 3.12 وأربع مكتبات وخادم نماذج وقاعدة بيانات، والخادم لا يملك شيئاً منها. Docker يحل هذا بتغليف البرنامج وكل ما يحتاجه في حاوية: صندوق مغلق يعمل بالشكل نفسه في أي مكان فيه Docker. تبني الصندوق مرة واحدة؛ والخادم فقط يشغله. هذه هي الفكرة كلها، ولهذا Docker هو المهارة الأولى قبل أي أداة نشر أخرى.

The supporting castالأدوات المساعدة

Docker Compose
Your whole stack in one fileمنظومتك كلها في ملف واحد
What it doesوظيفته Describes every service (agent, model, database) in one YAML fileيصف كل خدمة (الوكيل والنموذج وقاعدة البيانات) في ملف YAML واحد
Why it mattersأهميته One command starts, stops, and restarts everything togetherأمر واحد يشغل ويوقف ويعيد كل شيء معاً
Portainer
Docker without the terminalDocker بلا طرفية
What it doesوظيفته A browser dashboard over your containers: logs, restarts, updatesلوحة في المتصفح لحاوياتك: السجلات وإعادة التشغيل والتحديثات
Why it mattersأهميته Lets non-terminal people operate the server safelyيتيح لغير المتخصصين إدارة الخادم بأمان
Ollama
The model server in the stackخادم النماذج داخل المنظومة
What it doesوظيفته Serves your local model on port 11434 for every agent to callيقدم نموذجك المحلي على المنفذ 11434 لكل الوكلاء
Why it mattersأهميته Runs as a container next to the rest, GPU passed throughيعمل كحاوية بجانب الباقي، مع وصول للمعالج الرسومي
n8n (self-hosted)
The workflow engine, also a containerمحرك المسارات، وهو حاوية أيضاً
What it doesوظيفته Runs your visual agent workflows on the server, on schedule or on triggerيشغل مسارات وكلائك المرئية على الخادم، بجدول أو بحدث
Why it mattersأهميته The non-coder's whole orchestration layer in one imageطبقة التنظيم الكاملة لغير المبرمج في صورة واحدة

A full agent stack in one fileمنظومة وكلاء كاملة في ملف واحد

Here is the smallest honest example: a model server and a workflow engine, wired together, surviving reboots. Save it as docker-compose.yml on the server and run one command. This is genuinely how small the core of a deployment is.هذا أصغر مثال صادق: خادم نماذج ومحرك مسارات، موصولان معاً، ينجوان من إعادة تشغيل الخادم. احفظه باسم docker-compose.yml على الخادم ونفذ أمراً واحداً. هذا فعلاً حجم قلب النشر كله.

docker-compose.ymlملف docker-compose.yml
services:
  ollama:
    image: ollama/ollama
    volumes: ["ollama:/root/.ollama"]
    restart: unless-stopped

  n8n:
    image: n8nio/n8n
    ports: ["127.0.0.1:5678:5678"]
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
    volumes: ["n8n:/home/node/.n8n"]
    restart: unless-stopped

volumes:
  ollama:
  n8n:
Start everythingتشغيل كل شيء
docker compose up -d

# see what is running
docker compose ps

# read the logs of one service
docker compose logs n8n -f

Note the two quiet safety choices in that file: restart: unless-stopped brings every service back after a crash or reboot, and the n8n port is bound to 127.0.0.1, so it is reachable only from the server itself, not from the internet. You then access it through a VPN or an SSH tunnel. Those two lines prevent the two most common beginner disasters.لاحظ خياري الأمان الهادئين في الملف: restart: unless-stopped يعيد كل خدمة بعد العطل أو إعادة التشغيل، والمنفذ مربوط بـ 127.0.0.1 فلا يصل إليه أحد إلا من الخادم نفسه، لا من الإنترنت. ثم تدخل أنت عبر VPN أو نفق SSH. هذان السطران يمنعان أشهر كارثتين عند المبتدئين.

When you outgrow thisعندما تكبر عن هذا

One server with Compose carries most teams surprisingly far. You will know you have outgrown it when you need many servers, zero-downtime updates, or autoscaling; that is when Kubernetes enters. Do not start there. Start with one machine, one file, one command, and a backup of your volumes.خادم واحد مع Compose يكفي معظم الفرق أكثر مما يتوقعون. ستعرف أنك كبرت عنه عندما تحتاج عدة خوادم، أو تحديثات بلا توقف، أو توسعاً تلقائياً؛ عندها يأتي دور Kubernetes. لا تبدأ من هناك. ابدأ بجهاز واحد وملف واحد وأمر واحد، ونسخة احتياطية من بياناتك.

Shareشارك

Put one workflow into production.ضعوا عمليةً واحدة في الإنتاج.

A 15-minute call, then a real assessment of what an agent can run on your own servers.مكالمة من ١٥ دقيقة، ثم تقييم حقيقي لما يستطيع الوكيل تشغيله على خوادمكم.

Book a scoping call →احجز مكالمة تقييم ←
Keep readingتابع القراءة