Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Nettalco/dokploy/llms.txt

Use this file to discover all available pages before exploring further.

Schedules let you automate recurring work without external tools like Kubernetes CronJobs or third-party schedulers. Common use cases include database cleanup scripts, nightly report generation, cache warming, log rotation, and health-check pings. Each schedule stores the cron expression, the shell command, the target container, and a complete deployment history so you can audit every execution.

Schedule Types

Dokploy supports four schedule types that correspond to different execution targets.
An application schedule runs a command inside a running application container managed by Dokploy. The command is executed in the application’s container using the specified shell (bash or sh) via Docker exec.Use this type for tasks that are tightly coupled to your application code — database migrations, queue workers, report generators, or any script already present in your container image.
scheduleType: "application"
applicationId: "<your-application-id>"
command: "node scripts/cleanup.js"

Creating a Schedule

1

Navigate to the service

Open the application, Compose stack, or server you want to schedule tasks for inside the Dokploy dashboard.
2

Open the Schedules tab

Click the Schedules tab on the service detail page.
3

Click Add Schedule

Press Add Schedule to open the creation form.
4

Set the name and cron expression

Give the schedule a descriptive name and enter a valid cron expression (five fields: minute, hour, day-of-month, month, day-of-week). You can optionally set a timezone to pin the schedule to a specific region rather than the server’s local time.
5

Enter the command

Type the shell command to run inside the container. Select the shell type (bash or sh) that matches what is available in your image.
6

Save

Click Save. Dokploy calls schedule.create internally, registers the cron job with the scheduler, and shows the new schedule in the list. If enabled is true (the default), the job starts immediately on its next trigger time.
// Equivalent API call
const newSchedule = await trpc.schedule.create.mutate({
  name: "Nightly DB Cleanup",
  cronExpression: "0 2 * * *",
  timezone: "America/New_York",
  scheduleType: "application",
  applicationId: "app_abc123",
  command: "node scripts/db-cleanup.js",
  shellType: "bash",
  enabled: true,
});

Cron Expression Examples

Standard five-field cron syntax is used. All fields are required.
ExpressionMeaning
0 0 * * *Every day at midnight
0 */6 * * *Every 6 hours (00:00, 06:00, 12:00, 18:00)
*/15 * * * *Every 15 minutes
0 2 * * 0Every Sunday at 2 AM
0 9 * * 1-5Weekdays at 9 AM
30 8 1 * *First day of every month at 8:30 AM
0 0 1 1 *Once a year on January 1st at midnight
Cron expressions are evaluated in the server’s local timezone unless you supply an explicit timezone field when creating or updating the schedule. If your team spans multiple time zones, always set timezone explicitly (e.g., "UTC", "Europe/Berlin") to avoid unexpected trigger times after daylight-saving transitions.

Running Manually

To trigger a schedule immediately without waiting for its next cron tick, use schedule.runManually. This is useful for testing a new schedule or re-running a failed task.
await trpc.schedule.runManually.mutate({ scheduleId: "sched_abc" });
The same permission checks that apply to creation also apply to manual runs: server-level schedules require owner or admin role; application/compose schedules require the caller to have schedule.create permission and access to the parent service.

Viewing Schedule History

List schedules for a service

schedule.list returns all schedules attached to a given service or server, each including its most recent deployment records ordered by creation date.
const schedules = await trpc.schedule.list.query({
  id: "app_abc123",
  scheduleType: "application",
});
// Each schedule includes a `deployments` array with execution history

Inspect a single schedule

schedule.one fetches a single schedule by scheduleId, including its full configuration and deployment records.
const schedule = await trpc.schedule.one.query({ scheduleId: "sched_abc" });
// schedule.deployments contains timestamps and status for every past run

Updating and Deleting

Update a schedule

schedule.update accepts any field from the creation schema plus the required scheduleId. If the cron expression or enabled flag changes, Dokploy automatically re-registers (or removes) the underlying cron job.
await trpc.schedule.update.mutate({
  scheduleId: "sched_abc",
  cronExpression: "0 3 * * *", // moved from 2 AM to 3 AM
  enabled: true,
});

Delete a schedule

schedule.delete stops the cron job, removes it from the scheduler, and deletes the database record along with all execution history.
await trpc.schedule.delete.mutate({ scheduleId: "sched_abc" });

Build docs developers (and LLMs) love