If you run a hosting or service business, WHMCS is likely the engine that keeps your billing running smoothly. But there's one crucial detail many newcomers overlook: WHMCS doesn't do anything automatically until you set up its cron job. Without it, invoices won't generate, payment reminders won't send, and overdue accounts won't suspend. Let's fix that today with a clear, step-by-step walkthrough.
What Exactly Is the WHMCS Cron Job?
A cron job is simply a scheduled task that your server runs at set intervals. WHMCS uses a single "automation" cron to handle dozens of background tasks, including:
- Generating and emailing invoices before the due date
- Sending overdue payment reminders
- Attempting automatic payment captures on saved cards
- Suspending and terminating unpaid services
- Running daily currency updates and backups
In short, the cron is what turns WHMCS from a static database into a fully automated billing system. On Hostiso's NVMe DirectAdmin and cPanel plans, setting this up takes just a few minutes.
Important: Modern WHMCS versions (8.x) use a system cron that triggers a PHP script. You only need one cron entry running every 5 minutes — WHMCS handles the internal scheduling from there.
Step 1: Find Your WHMCS Cron File Path
First, you need to know where WHMCS is installed. Your cron script lives inside the crons folder of your WHMCS directory. A typical full path looks like this:
/home/yourusername/public_html/whmcs/crons/cron.php
If you installed WHMCS in a subfolder like billing, adjust accordingly:
/home/yourusername/domains/yourdomain.com/public_html/billing/crons/cron.php
Not sure of the exact path? Open the WHMCS admin area and go to Configuration → System Settings → Automation Settings. WHMCS will display the recommended full cron command right at the top of that page — just copy it.
Step 2: Add the Cron Job in DirectAdmin
DirectAdmin makes this refreshingly simple:
- Log in to your DirectAdmin control panel.
- Under the Advanced Features section, click Cron Jobs.
- Set the schedule to run every 5 minutes. In the minute field enter
*/5and leave hour, day, month, and weekday as*. - In the command field, paste your cron command:
php -q /home/yourusername/public_html/whmcs/crons/cron.php
- Click Add. That's it!
Your final cron schedule fields should look like this:
| Minute | Hour | Day | Month | Weekday |
|---|---|---|---|---|
| */5 | * | * | * | * |
Step 3: Add the Cron Job in cPanel
Prefer cPanel? The process is nearly identical:
- Log in to cPanel and scroll to the Advanced section.
- Click Cron Jobs.
- Under "Add New Cron Job," use the Common Settings dropdown and choose Every 5 Minutes, or manually enter
*/5in the Minute field with*in the rest. - Paste the same command into the Command box:
php -q /home/yourusername/public_html/whmcs/crons/cron.php
- Click Add New Cron Job.
Pro Tip: Add>/dev/null 2>&1to the end of your command to prevent your inbox from filling up with cron output emails every 5 minutes. Example:php -q /home/user/public_html/whmcs/crons/cron.php >/dev/null 2>&1
Step 4: Configure Automation Settings in WHMCS
Now that the cron is firing, tell WHMCS what to do and when:
- In the WHMCS admin, go to Configuration → System Settings → Automation Settings.
- Set the Time of Day for daily tasks (invoice generation, reminders). Something like
09:00works well. - Under Invoice Generation, choose how many days before the due date invoices are created (7 days is common).
- Configure suspension and termination timing under the relevant sections to match your business policy.
- Save your changes.
Step 5: Verify the Cron Is Actually Running
Don't just assume it works — confirm it. Head back to Configuration → System Settings → Automation Settings and look at the top of the page. You'll see a status message such as:
The System Cron last ran at [date and time]
If the timestamp is recent (within the last few minutes), you're golden. If it says the cron has never run or hasn't run recently, double-check your path and PHP command.
Common Cron Problems and Quick Fixes
The cron never runs
Usually a wrong file path. Copy the exact command shown in WHMCS Automation Settings rather than typing it manually. Also verify the php binary works — some servers require the full path like /usr/local/bin/php.
Invoices aren't generating
Confirm the daily automation time hasn't already passed for the day, and that invoice generation days are set. WHMCS runs daily tasks once per day at your chosen time — not every 5 minutes.
Getting flooded with cron emails
Append >/dev/null 2>&1 as noted above to silence routine output while still letting genuine errors surface in WHMCS logs.
Warning: Never set the cron to run more frequently than every 5 minutes, and never add multiple cron entries for the same script. Overlapping runs can cause duplicate invoices or payment attempts.
Why This Runs So Smoothly on Hostiso
Because Hostiso servers ship with a properly configured PHP environment, LiteSpeed, and CloudLinux LVE resource isolation, your WHMCS cron runs reliably without competing for resources with other accounts. The Enterprise NVMe storage means those daily billing tasks — even across hundreds of clients — complete in seconds. And with DirectAdmin's clean Cron Jobs interface, you never need to touch the command line unless you want to.
You're All Set
With a single cron job running every 5 minutes and your automation settings dialed in, WHMCS will now handle invoicing, reminders, payments, and suspensions completely on autopilot. Set it once, verify the timestamp, and get back to growing your business. If you ever run into a cron that won't fire, our Hostiso support team is happy to check the server side for you.