Cron jobs on Cloudways let you schedule recurring tasks so they run automatically at set intervals. Common uses include clearing WordPress transients, sending automated emails, importing product feeds, running database maintenance scripts, and triggering WooCommerce stock updates without manual action each time.
This guide is part of our Cloudways management and maintenance guide, which covers backups, logs, and scaling alongside cron jobs.
What Is a Cron Job?
A cron job is a Linux-based scheduled task that runs a script or command at a defined time or interval. On Cloudways, cron jobs are managed per application from the dashboard, without needing SSH or editing system files directly. The name comes from cron, the standard Unix time-based job scheduler used across Linux servers.
Cron Schedule Format
Cloudways offers preset intervals in a dropdown: every 15 minutes, 30 minutes, hourly, daily, weekly, and monthly. For a custom schedule, enter standard cron syntax using five space-separated fields:
- Minute: 0-59
- Hour: 0-23 (24-hour clock)
- Day of month: 1-31
- Month: 1-12
- Day of week: 0-7 (both 0 and 7 equal Sunday)
Common examples:
0 * * * *runs at the top of every hour30 3 * * *runs at 3:30 AM every day0 0 * * 1runs at midnight every Monday*/15 * * * *runs every 15 minutes
How to Create a Cron Job on Cloudways
Step 1: Log In
Log into your Cloudways Platform dashboard using your credentials.

Step 2: Select Your Application
Click Applications in the top navigation and select the application where you want to add the cron job.

Step 3: Open Cron Job Management
Inside the application settings, find Cron Job Management and click Add New Cron Job.

Step 4: Set the Schedule and Script Type
Choose your interval from the dropdown or select Custom to enter a cron expression manually. Then choose the script type that matches your command:
- PHP: runs a PHP file directly. The command path must be absolute, pointing to the script inside your application folder.
- curl: sends an HTTP request to a URL. Commonly used to trigger WordPress WP-Cron over HTTP.
- wget: retrieves a URL silently. Functionally similar to curl for most scheduled HTTP tasks.
Enter the command to execute and click Submit. The cron job will appear under the Basic tab, where you can also edit or delete it later.

Environment Variables in Cloudways Cron Jobs
Cron jobs run in a minimal environment: they do not automatically inherit the same environment variables as your web server process. This causes scripts that work fine through the browser to fail silently when run via cron.
The most common issues:
- PHP binary not found: If a PHP cron job fails with a “command not found” error, the cron environment does not know where PHP is. Use the full path to the PHP binary in your command. On Cloudways, PHP binaries typically live at
/usr/bin/phpor a versioned path like/usr/bin/php8.1. You can confirm the exact path by runningwhich phpin an SSH session. - Application folder paths: Cron scripts should reference absolute paths to files. Relative paths work in your shell because your shell sets the working directory; cron does not. You will need your application folder name on Cloudways to build the correct path.
- Database credentials: PHP scripts that connect to a database should read credentials from your application’s configuration file (wp-config.php for WordPress), not from environment variables assumed to be set. If your script calls
getenv('DB_PASSWORD')and that variable is only exported in your web server config, cron will get an empty value. - Missing extensions: The PHP binary called by cron may not load the same extensions as the web server’s PHP-FPM instance. If a script uses a specific extension (such as
intlorimagick), verify it is available in the PHP CLI version you are calling.
For WP-Cron replacements using the curl script type, environment variables are not a concern: curl sends an HTTP request through the web server, which runs in the full application environment.
WordPress: Replace WP-Cron With a Server Cron
By default, WordPress uses WP-Cron to handle scheduled tasks such as publishing posts, checking for updates, and sending emails. WP-Cron fires only when someone loads a page on your site. On low-traffic sites, scheduled tasks may be delayed. On high-traffic sites, every page load adds a small overhead check.
Replacing WP-Cron with a real server cron job fixes both problems. To do this:
- Open
wp-config.phpin your application and adddefine('DISABLE_WP_CRON', true);above the line that reads/* That's all, stop editing! */. - In Cloudways Cron Job Management, create a new cron job using the curl type.
- Set the URL to your site’s WP-Cron endpoint. For example:
https://yourdomain.com/wp-cron.php?doing_wp_cron(replace yourdomain.com with your actual domain). - Set the interval to every 5 or 10 minutes depending on how frequently your scheduled tasks need to fire.
After setting this up, verify jobs are running as expected by reviewing your Cloudways application logs for errors. You will also need your application folder name on Cloudways when building absolute PHP file paths.
Real-World Cloudways Cron Job Examples
Below are common cron job patterns for WordPress sites on Cloudways, with the schedule syntax and script type for each.
Replace WP-Cron (Every 5 Minutes)
- Schedule:
*/5 * * * * - Type: curl
- Command:
https://yourdomain.com/wp-cron.php?doing_wp_cron - When to use: After disabling WP-Cron in wp-config.php. Ensures scheduled posts, email queues, and plugin tasks fire on time regardless of traffic levels.
Weekly Database Optimization
- Schedule:
0 3 * * 0(3 AM every Sunday) - Type: PHP
- What it does: Runs a cleanup script to remove post revisions, expired transients, and auto-draft posts. Plugins like WP-Optimize can be triggered via a curl call to the WP-Cron endpoint instead.
WooCommerce Stock Sync
- Schedule:
*/30 * * * *(every 30 minutes) - Type: curl or PHP
- When to use: For stores syncing inventory with an external ERP or warehouse API. Trigger the sync endpoint every 30 minutes to keep stock counts current without manual updates.
Daily Log Rotation
- Schedule:
0 1 * * *(1 AM daily) - Type: PHP
- What it does: Deletes or archives plugin log files older than 7 days. Cloudways application logs rotate automatically, but custom plugin logs often accumulate without any cleanup.
Troubleshooting Cloudways Cron Jobs
If a cron job is not running or returning errors, check these common causes:
- Wrong file path: cron does not inherit your shell environment, so relative paths fail silently. Use the full absolute path to the script.
- Permission errors: the script must be readable by the server user. If cron jobs fail because of permissions, check and reset your Cloudways file and folder permissions.
- PHP errors in the script: a syntax error or missing dependency causes the script to exit early. Enable PHP error logging on the application and check the Cloudways application logs to capture these.
- Script timeout: tasks that run longer than the server’s execution time limit will be terminated. Break large jobs into smaller batches or increase the PHP time limit for that application.
- Duplicate WP-Cron runs: if you set up a server cron for WP-Cron but did not add
define('DISABLE_WP_CRON', true);towp-config.php, scheduled tasks will run twice. - Insufficient privileges: only account owners and team members with full privileges can create, edit, or delete cron jobs on Cloudways.
- Environment variable issues: the cron process does not inherit web server environment variables. Any script reading
getenv()values that are only set in the PHP-FPM pool config will receive empty values. Hard-code the path to your application config file instead.
Testing Your Cron Job Before Relying on It
Before a cron job is confirmed working, the first scheduled run might be hours away. These steps let you verify the job works without waiting:
- For curl jobs: copy the URL from the cron job definition and paste it directly into a browser or run it with
curl -v "https://yourdomain.com/wp-cron.php?doing_wp_cron"via SSH. A 200 response means the endpoint is reachable. - For PHP jobs: log in via SSH and run the script manually using the same PHP path and file path you entered in the cron definition. Any errors will appear in the terminal immediately rather than being silently swallowed.
- Check the application log after the first scheduled run: go to Application > Logs > Error Log in the Cloudways dashboard. If the script produced any PHP warnings or fatal errors on the first run, they will appear here.
- Set a short interval temporarily: if the job is supposed to run daily, set it to every 15 minutes initially, confirm it fires and produces the right output, then change it to the intended schedule.
Final Word: Cloudways Cron Job Management
Running cron jobs on Cloudways is managed from the application dashboard in a few straightforward steps. Whether you are scheduling PHP scripts, triggering HTTP endpoints with curl, or replacing WordPress WP-Cron with a server-side schedule, the Cron Job Management panel handles it without SSH. Watch for environment variable differences between the cron process and the web server if PHP scripts that work in the browser fail when scheduled. For a full picture of what Cloudways offers, see the Cloudways review.