אוטומציה שיווקית בקוד פתוח לא חייבת להוות ויתור על הנתונים שלכם לטובת ספק SaaS. Mautic מציבה קמפיינים במייל, מעקב אחר אנשי קשר וטיפוח לידים (lead nurturing) תחת הקורת הגג שלכם. הרצה על Ubuntu 24.04 דורשת מאמץ רב יותר מאשר התחברות ל-HubSpot, אך התגמול הוא שליטה מלאה ב-stack שלכם, בעלויות שלכם ובנתוני הלקוחות שלכם. אתם מחליטים מתי לעדכן, איך להתרחב (scale), ואיפה המידע שלכם נמצא.

לפני שמתחילים, כוונו דומיין לשרת שלכם וודאו של-instance של Ubuntu 24.04 יש לפחות 2 GB של RAM. Mautic אינה קלה; PHP תצרוך זיכרון כאשר היא בונה מחדש סגמנטים גדולים או מעבדת לוגיקה של קמפיינים. אם אתם מתכננים לשלוח לאלפי אנשי קשר, 4 GB יהפכו את החוויה להרבה יותר חלקה.

בניית תשתית ה-LEMP

Mautic מצפה ל-LEMP stack: Nginx, MySQL ו-PHP. ב-Ubuntu 24.04, גרסת ה-PHP ברירת המחדל היא 8.3, שעובדת היטב עם גרסאות Mautic הנוכחיות. התחילו בעדכון רשימת החבילות שלכם, ולאחר מכן התקינו את Nginx ו-MySQL Server. לאחר מכן, התקינו את PHP-FPM ואת התוספים המדויקים ש-Mautic זקוקה להם:

  • php-fpm
  • php-mysql
  • php-imap
  • php-curl
  • php-gd
  • php-xml
  • php-mbstring
  • php-zip
  • php-intl
  • php-bcmath

לכל תוסף יש מטרה ממשית. תוסף ה-IMAP קורא הודעות bounce ותשובות להסרה מרשימת תפוצה (unsubscribe). GD מטפל בעיבוד תמונה עבור thumbnails. Mbstring ו-Intl מנהלים סטים של תווים ותרגומים בין שפות. BCMath מספק לכם חישובים מתמטיים מדויקים עבור lead scoring וחישובי מטבעות. אל תוותרו על אף אחד מהם, אחרת המתקין יתלונן באמצע התהליך.

אם Apache כבר מותקן, הסירו אותו. שני שרתי האינטרנט רוצים להשתמש בפורטים 80 ו-443. הרצתם זה לצד זה גורמת לכשלים שקטים שקשה מאוד לדבג. הרצה נקייה של apt remove apache2 ולאחריה apt autoremove תמנע את הכאב ראש הזה לחלוטין.

כיוונון PHP ובסיס הנתונים

המתקין של Mautic ותהליכי הרקע שלה צורכי זיכרון גבוהים. פתחו את קובץ ההגדרות של PHP-FPM, הממוקם ב-/etc/php/8.3/fpm/php.ini, והעלו את מגבלת הזיכרון (memory limit) ל-512 MB. הגדירו את גודל ההעלאה (upload size) ל-50 MB כדי שתוכלו לייבא רשימות אנשי קשר וחבילות נכסים (asset bundles) מבלי להיתקל במגבלות שרירותיות. לאחר השמירה, הפעילו מחדש את PHP-FPM כדי להחיל את השינויים. בזמן שאתם כבר שם, הגדילו את post_max_size כך שיתאים למגבלת ההעלאה שלכם; אחרת, PHP תדחה שליחת טפסים מרובי חלקים (multipart form submissions) גדולים גם אם upload_max_filesize נראה תקין.

לאחר מכן, צרו בסיס נתונים ומשתמש MySQL ייעודיים. קראו לבסיס הנתונים איך שתרצו, אך שמרו את שם המשתמש והסיסמה במנהל סיסמאות. Mautic שומרת כל פעולת איש קשר, החלטת קמפיין ואירוע פתיחת אימייל בטבלאות אלו, לכן מתן הרשאות רחבות לחשבון בעל מטרה אחת בלבד מגביל את החשיפה במקרה שמשהו אחר בשרת נפרץ.

התקנת Mautic והכלים שלה

הורידו את הגרסה היציבה האחרונה של Mautic וחלצו אותה לתוך /var/www/html/mautic. הגדירו את בעל הספרייה ל-www-data כדי ששרת האינטרנט יוכל לכתוב קבצי cache, לוגים ועדכוני הגדרות מקומיים. ב-Ubuntu, זה אומר להריץ chown -R www-data:www-data /var/www/html/mautic.

אתם זקוקים גם ל-Composer ו-npm מותקנים בשרת. Composer פותר תלויות (dependencies) של PHP, וגם אם תפרסו מהארכיון המוכן מראש, תזדקקו ל-Composer מאוחר יותר בעת הוספת תוספים מה-marketplace או הרצת עדכונים ידניים. npm חשוב אם תרצו מתישהו להתאים אישית ערכות נושא (themes) או לבנות נכסי frontend ממקור הקוד. הכנת שני הכלים הללו כבר עכשיו תחסוך לכם חיפושים דחופים כשהפרויקט יתפתח.

הגדרת Nginx ונעילת האבטחה

ה-virtual host של Nginx שלכם צריך להפנות את ספריית ה-root שלו ל-/var/www/html/mautic ולהתייחס ל-index.php כאינדקס ברירת המחדל. נתבו בקשות PHP לסוקט ה-Unix ש-PHP-FPM פותח, בדרך כלל ב-/run/php/php8.3-fpm.sock. בלוק שרת (server block) איתן כולל הנחיית try_files שחוזרת ל-front controller, בתוספת בלוק location שחוסם גישה לקבצים נסתרים המתחילים בנקודה. Mautic מגיעה עם קבצי .htaccess המיועדים ל-Apache, אך Nginx מתעלם מהם, לכן כללים מפורשים של deny ב-virtual host שלכם ישמרו על הלוגים ועל תיקיות הזמני שלכם פרטיים.

לפני שתריצו את המתקין מבוסס האינטרנט, השיגו תעודת TLS. השתמשו ב-Certbot עם התוסף של Nginx כדי למשוך תעודה חינמית של Let's Encrypt ולשכתב באופן אוטומטי את תעבורת ה-HTTP שלכם ל-HTTPS. Mautic מטפלת בפרטי התחברות ובנתוני אנשי קשר; אין שום תירוץ להגיש אותם בטקסט גלוי (plain text).

Cron Jobs הם המנוע

This step is non-negotiable. Without scheduled tasks, Mautic is a dashboard that does nothing. The application queues campaign actions, email sends, and segment recalculations in the database, then relies on the command line to process them.

Set up cron jobs for the Mautic user to handle these background duties:

  • Updating segments
  • Running campaigns
  • Sending emails
  • Fetching bounces

In practice, that means invoking Mautic’s console commands at different intervals. Segment rebuilds can run hourly. Campaign triggers and email queue processing usually need a tighter window, every five to fifteen minutes depending on volume. Bounce fetching via IMAP should run regularly enough that your sender reputation does not suffer from unchecked spam complaints. Watch your syslog or the cron output to confirm they finish without memory errors.

Using the Platform

Once the installer completes and cron is humming, log into the dashboard. The interface centers on three building blocks: contacts, segments, and campaigns.

Use the drag-and-drop campaign builder to design email workflows. A new subscriber enters the flow, waits a day, receives a welcome message, and branches based on whether they clicked a link. Meanwhile, the Points system quietly scores leads when they visit pricing pages or open product announcements. You decide the thresholds that signal a hot lead worth a sales call.

Segments group contacts automatically by rules you define. You might segment everyone who opened a campaign in the last thirty days, or isolate contacts in a specific country. Forms living on your landing pages feed directly into these segments. Link the pieces together and you have an automated nurture sequence that reacts to behavior instead of blasting the same message to your entire list.

The Real Work After Deploy

Standing up Mautic on Ubuntu 24.04 is only the beginning. Back up your database and your /var/www/html/mautic directory before every update. Watch PHP error logs when you install new plugins. Test cron output after you scale your contact list upward, because a job that finishes in seconds at one thousand contacts may time out at fifty thousand.

Self-hosting trades the convenience of a managed SaaS for sovereignty over your marketing data. There is no vendor lock-in, no per-contact pricing surprises, and no third-party holding your analytics hostage. You own the server, the database, and the relationship with your audience. For teams willing to maintain a Linux box and a handful of cron expressions, that trade is usually worth it.