CalDAV Synchronization
April 17, 2026 · View on GitHub
This guide explains how to configure and use CalDAV synchronization in Tududi to access your tasks across multiple devices and applications.
Related: Tasks Behavior, Recurring Tasks, Architecture Overview
Table of Contents
- Overview
- How CalDAV Works
- Why Use CalDAV
- Supported Clients
- Configuration
- Client Setup Guides
- Remote Server Synchronization
- User Features
- Advanced Topics
- Troubleshooting
- Security Considerations
Overview
CalDAV (Calendar Distributed Authoring and Versioning) is an industry-standard protocol for accessing and managing calendar data. Tududi implements CalDAV to enable task synchronization with external applications and servers.
Key Features:
- Bidirectional Sync: Changes sync in both directions (Tududi ↔ CalDAV clients/servers)
- Popular Client Support: tasks.org, Apple Reminders, Thunderbird, Evolution, and more
- Recurring Tasks: Full support via RRULE (RFC 5545)
- Conflict Detection: Automatic conflict detection with configurable resolution strategies
- Background Sync: Automatic periodic synchronization
- Standards-Compliant: Implements RFC 4791 (CalDAV) and RFC 5545 (iCalendar)
How CalDAV Works
The Protocol
CalDAV extends WebDAV to provide a standard way of accessing and managing calendar objects over HTTP. In Tududi:
- Tasks as VTODO: Tududi tasks are represented as iCalendar VTODO components
- HTTP Methods: Standard HTTP methods (GET, PUT, DELETE) plus WebDAV extensions (PROPFIND, REPORT)
- Discovery: Clients find calendars via
.well-known/caldavendpoint - Authentication: HTTP Basic Auth for CalDAV clients, sessions/tokens for web UI
Data Flow
CalDAV Client Access:
┌─────────────────┐
│ CalDAV Client │ (tasks.org, Thunderbird, etc.)
│ (Mobile/PC) │
└────────┬────────┘
│ HTTP Basic Auth
│ PROPFIND, REPORT, GET, PUT, DELETE
▼
┌─────────────────┐
│ Tududi │ Serves as CalDAV server
│ CalDAV Server │ /caldav/{username}/tasks/
└────────┬────────┘
│
▼
┌─────────────────┐
│ SQLite Database │ Tasks stored with CalDAV metadata
│ (tasks table) │ (ETags, CTags, sync state)
└─────────────────┘
Remote Server Sync:
┌─────────────────┐
│ Tududi │ Acts as CalDAV client
│ CalDAV Client │
└────────┬────────┘
│ Periodic sync (every 5-60 min)
│ PROPFIND, REPORT, GET, PUT, DELETE
▼
┌─────────────────┐
│ Remote CalDAV │ Nextcloud, Baikal, etc.
│ Server │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Remote Tasks │ Synced bidirectionally
└─────────────────┘
Synchronization Process
Tududi uses a three-phase sync algorithm:
1. Pull Phase:
- Fetch changes from remote CalDAV server
- Parse VTODO items into Tududi task format
- Store in temporary buffer
2. Merge Phase:
- Compare local and remote versions using ETags
- Detect conflicts (both modified since last sync)
- Apply conflict resolution strategy:
last_write_wins: Keep most recent changelocal_wins: Always keep Tududi versionremote_wins: Always keep remote versionmanual: Flag for user resolution
3. Push Phase:
- Identify local changes since last sync
- Serialize tasks to VTODO format
- PUT to remote server
- Update sync state (ETags, timestamps)
Task Transformation
Tududi Task → VTODO:
// Tududi task
{
uid: "abc123",
name: "Buy groceries",
due_date: "2026-04-20T14:00:00Z",
status: 0, // NOT_STARTED
priority: 2 // High
}
// Becomes VTODO
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Tududi//CalDAV Server//EN
BEGIN:VTODO
UID:abc123
SUMMARY:Buy groceries
DUE:20260420T140000Z
STATUS:NEEDS-ACTION
PRIORITY:3
CREATED:20260415T100000Z
DTSTAMP:20260415T100000Z
END:VTODO
END:VCALENDAR
Change Detection
ETags (Entity Tags):
- Unique identifier for each task version
- Generated from task's
updated_attimestamp - Clients use ETags to detect changes efficiently
If-Matchheaders prevent conflicting updates
CTags (Collection Tags):
- Single tag for entire calendar collection
- Changes whenever any task in calendar changes
- Enables quick "has anything changed?" check
- Reduces unnecessary full syncs
Recurring Task Handling
Tududi stores recurring tasks as single parent tasks with recurrence rules:
Storage:
- Parent task stored once with RRULE
- No duplicate database entries for future instances
- Configurable expansion limit (default: 365 instances)
CalDAV Serialization:
- Parent task expanded into virtual instances on-demand
- Each instance gets unique RECURRENCE-ID
- Clients see discrete VTODO entries
- Modified instances stored in
caldav_occurrence_overridestable
Example:
Parent Task: "Daily standup"
recurrence_pattern: "daily"
due_date: "2026-04-20T09:00:00Z"
CalDAV Expansion:
- VTODO (UID: daily-standup, RECURRENCE-ID: 20260420T090000Z)
- VTODO (UID: daily-standup, RECURRENCE-ID: 20260421T090000Z)
- VTODO (UID: daily-standup, RECURRENCE-ID: 20260422T090000Z)
... (up to 365 future instances)
Why Use CalDAV
For Mobile Users:
- Access tasks on Android/iOS via tasks.org or Apple Reminders
- Offline access with eventual sync
- Native mobile notifications and widgets
- Work seamlessly across devices
For Desktop Users:
- Use Thunderbird or Evolution for desktop task management
- Integrated with email workflow
- Keyboard shortcuts and power user features
- Calendar/task views side-by-side
For Self-Hosters:
- Sync with existing infrastructure (Nextcloud, Baikal)
- Keep data on your own servers
- No third-party cloud dependencies
- Standards-based interoperability
For Teams:
- Share Tududi tasks via CalDAV-compatible platforms
- Collaborate using familiar tools (Nextcloud Tasks)
- Maintain single source of truth (Tududi)
- Cross-platform compatibility
Configuration
CalDAV is configured via environment variables in your .env file. After making changes, restart the Tududi server for them to take effect.
Quick Setup
Enable CalDAV:
# Enable CalDAV feature
CALDAV_ENABLED=true
# Encryption key for remote calendar passwords (32 characters minimum)
ENCRYPTION_KEY=$(openssl rand -hex 32)
# Optional: Configure defaults
CALDAV_DEFAULT_SYNC_INTERVAL=15 # Minutes between syncs
CALDAV_MAX_RECURRING_INSTANCES=365 # Future recurring instances
CALDAV_CONFLICT_RESOLUTION=last_write_wins # Default strategy
Restart Tududi:
docker compose restart # For Docker
npm start # For standalone
Configure in Web UI:
- Navigate to Profile > Settings > CalDAV tab
- Click Add Calendar to create a local calendar
- Click Add Remote Calendar to sync with external servers
- Follow the setup wizard
Environment Variables Reference
| Variable | Required | Default | Description |
|---|---|---|---|
CALDAV_ENABLED | Yes | false | Enable/disable CalDAV feature |
ENCRYPTION_KEY | Recommended | SECRET_KEY | AES-256-GCM encryption key for passwords |
CALDAV_DEFAULT_SYNC_INTERVAL | No | 15 | Default sync interval in minutes |
CALDAV_MAX_RECURRING_INSTANCES | No | 365 | Max future recurring instances to expand |
CALDAV_CONFLICT_RESOLUTION | No | last_write_wins | Default conflict strategy |
CALDAV_RATE_LIMIT | No | 60 | Requests per minute per IP |
CALDAV_MAX_SYNC_TASKS | No | 1000 | Max tasks per sync operation |
CALDAV_REQUEST_TIMEOUT | No | 30000 | Request timeout in milliseconds |
CALDAV_LOG_LEVEL | No | info | Log level: error, warn, info, debug |
CALDAV_LOG_REQUESTS | No | false | Log all CalDAV HTTP requests |
Important: The ENCRYPTION_KEY should be a secure random string (32 bytes). If not set, falls back to SECRET_KEY.
Conflict Resolution Strategies:
last_write_wins: Most recent change wins (default, recommended)local_wins: Always keep Tududi's versionremote_wins: Always keep remote server's versionmanual: Flag conflicts for manual resolution in UI
Supported Clients
Client Setup Guides
tasks.org (Android/iOS)
Setup Instructions:
- Open tasks.org app
- Tap ☰ Menu > Settings > Synchronization
- Select CalDAV
- Enter connection details:
- URL:
https://your-tududi-domain.com/caldav/ - Username: Your Tududi email
- Password: Your Tududi password
- URL:
- Tap Add Account
- Select the tasks calendar
- Tap Sync to start synchronization
Features:
- ✅ Full task CRUD (create, read, update, delete)
- ✅ Recurring tasks with RRULE
- ✅ Due dates and start dates (defer until)
- ✅ Priority levels
- ✅ Task status (needs action, in progress, completed)
- ✅ Subtasks via RELATED-TO
- ⚠️ Limited: Habit mode, tags stored in custom fields
Apple Reminders (iOS/macOS)
Setup Instructions (iOS):
- Open Settings > Reminders > Accounts
- Tap Add Account > Other
- Select Add CalDAV Account
- Enter connection details:
- Server:
your-tududi-domain.com - Username: Your Tududi email
- Password: Your Tududi password
- Description: Tududi Tasks
- Server:
- Tap Next > Save
- Open Reminders app to view synced tasks
Setup Instructions (macOS):
- Open System Settings > Internet Accounts
- Click + > Add Other Account > CalDAV Account
- Enter connection details:
- Account Type: Manual
- Username: Your Tududi email
- Password: Your Tududi password
- Server Address:
https://your-tududi-domain.com/caldav/
- Click Sign In
- Open Reminders app to view synced tasks
Features:
- ✅ Task creation and editing
- ✅ Due dates and reminders
- ✅ Priority levels (high, medium, low)
- ✅ Task completion
- ✅ Recurring tasks (limited patterns)
- ⚠️ Limited: Advanced recurrence patterns, custom fields
Thunderbird (Desktop)
Setup Instructions:
- Install Lightning or Task Calendar extension (if not built-in)
- Open Calendar tab
- Right-click in calendar list > New Calendar
- Select On the Network
- Choose CalDAV
- Enter connection details:
- Location:
https://your-tududi-domain.com/caldav/{your-username}/tasks/ - Replace
{your-username}with your Tududi username
- Location:
- Enter credentials when prompted
- Select Tasks calendar type
- Click Finish
Features:
- ✅ Full task management
- ✅ Recurring tasks with advanced patterns
- ✅ Due dates, start dates, completion dates
- ✅ Priority and status
- ✅ Task descriptions (notes)
- ✅ Subtask hierarchy
Evolution (Linux)
Setup Instructions:
- Open Evolution > File > New > Task List
- Select CalDAV
- Enter connection details:
- URL:
https://your-tududi-domain.com/caldav/{your-username}/tasks/ - Username: Your Tududi email
- Password: Your Tududi password
- URL:
- Click Apply
- View tasks in Tasks view
Features:
- ✅ Full task CRUD
- ✅ Recurring tasks
- ✅ Due dates and priorities
- ✅ Task completion tracking
Remote Server Synchronization
Tududi can sync with external CalDAV servers like Nextcloud, Baikal, or other CalDAV-compatible services.
Overview
When configured as a CalDAV client, Tududi periodically fetches changes from remote servers and pushes local changes back. This enables:
- Cloud Backup: Keep tasks synced with cloud CalDAV services
- Multi-Instance Sync: Run multiple Tududi instances synced via central server
- Legacy Integration: Sync with existing calendar infrastructure
Nextcloud
Setup Instructions:
- In Tududi, go to Profile > Settings > CalDAV tab
- Click Add Remote Calendar
- Select Nextcloud as server type
- Enter connection details:
- Name: My Nextcloud Tasks
- Server URL:
https://your-nextcloud-domain.com - Calendar Path:
/remote.php/dav/calendars/{username}/tasks/- Replace
{username}with your Nextcloud username
- Replace
- Username: Your Nextcloud username
- Password: Your Nextcloud password or app password
- Choose sync direction:
- Bidirectional: Changes sync both ways
- Pull Only: Import from Nextcloud to Tududi
- Push Only: Export from Tududi to Nextcloud
- Set sync interval (default: 15 minutes)
- Click Save
- Click Sync Now to test connection
Creating App Password (Recommended):
- In Nextcloud, go to Settings > Security
- Scroll to Devices & sessions
- Enter app name:
Tududi - Click Create new app password
- Copy the generated password
- Use this password in Tududi CalDAV settings
Baikal
Setup Instructions:
- In Tududi, go to Profile > Settings > CalDAV tab
- Click Add Remote Calendar
- Select Baikal as server type
- Enter connection details:
- Name: My Baikal Tasks
- Server URL:
https://your-baikal-domain.com - Calendar Path:
/dav.php/calendars/{username}/tasks/- Replace
{username}with your Baikal username
- Replace
- Username: Your Baikal username
- Password: Your Baikal password
- Configure sync settings
- Click Save and Sync Now
Generic CalDAV Server
Setup Instructions:
- In Tududi, go to Profile > Settings > CalDAV tab
- Click Add Remote Calendar
- Select Generic CalDAV as server type
- Enter connection details:
- Name: Custom calendar name
- Server URL: Full CalDAV server URL
- Calendar Path: Path to specific calendar
- Username: Your CalDAV username
- Password: Your CalDAV password
- Auth Type: Basic (default)
- Configure sync settings
- Click Save and Sync Now
Finding Your Calendar Path:
Most CalDAV servers follow this pattern:
/calendars/{username}/{calendar-name}/
Check your CalDAV server's documentation for the exact path format.
Configuration Options
Sync Direction
- Bidirectional: Changes sync in both directions (default)
- Pull Only: Import tasks from remote to Tududi
- Push Only: Export tasks from Tududi to remote
Sync Interval
Choose how frequently automatic sync runs:
- 5 minutes
- 15 minutes (default)
- 30 minutes
- 60 minutes
- Manual only (disable automatic sync)
Conflict Resolution
When the same task is modified both locally and remotely:
- Last Write Wins: Most recent change overwrites older change (default)
- Local Wins: Always keep Tududi's version
- Remote Wins: Always keep remote server's version
- Manual: Flag conflicts for manual resolution in UI
Field Mappings
Task Fields → VTODO Properties
| Tududi Field | VTODO Property | Notes |
|---|---|---|
| Name | SUMMARY | Task title |
| Note | DESCRIPTION | Task description |
| Due Date | DUE | ISO 8601 UTC timestamp |
| Defer Until | DTSTART | Start date/time |
| Completed At | COMPLETED | Completion timestamp |
| Status | STATUS | See status mapping below |
| Priority | PRIORITY | Inverse scale (see below) |
| Recurrence | RRULE | RFC 5545 recurrence rule |
| Subtasks | RELATED-TO | Parent task UID |
Status Mapping
| Tududi Status | VTODO STATUS |
|---|---|
| Not Started | NEEDS-ACTION |
| In Progress | IN-PROCESS |
| Done | COMPLETED |
| Archived | COMPLETED |
| Waiting | NEEDS-ACTION |
| Cancelled | CANCELLED |
| Planned | NEEDS-ACTION |
Priority Mapping
CalDAV uses inverse priority scale (1=highest, 9=lowest):
| Tududi Priority | VTODO PRIORITY |
|---|---|
| High (2) | 3 |
| Medium (1) | 5 |
| Low (0) | 7 |
Custom Fields
Tududi-specific features are stored as extended properties:
X-TUDUDI-HABIT-MODE: Habit tracking settingsX-TUDUDI-PROJECT-UID: Project associationX-TUDUDI-TAGS: Task tags (comma-separated)
These fields are preserved but may not be visible in external clients.
Recurring Tasks
Tududi supports CalDAV recurring tasks via RRULE (RFC 5545):
Supported Patterns
| Pattern | RRULE Example |
|---|---|
| Daily | FREQ=DAILY |
| Every N days | FREQ=DAILY;INTERVAL=3 |
| Weekly | FREQ=WEEKLY;BYDAY=MO,WE,FR |
| Monthly by day | FREQ=MONTHLY;BYMONTHDAY=15 |
| Monthly by weekday | FREQ=MONTHLY;BYDAY=2TH (2nd Thursday) |
| Yearly | FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1 |
Limitations
- External clients see individual instances (next 365 occurrences)
- Editing a single instance creates an override
- Deleting parent task removes all instances
Troubleshooting
Authentication Fails
Symptoms: Client can't connect, 401 Unauthorized error
Solutions:
- Verify credentials (email and password are correct)
- Check that
CALDAV_ENABLED=truein environment - Ensure HTTP Basic Auth is supported by client
- Try creating a new API token in Profile settings
Tasks Not Syncing
Symptoms: Changes don't appear after sync
Solutions:
- Check sync status in CalDAV tab (last sync time, errors)
- Click Sync Now to force manual sync
- Verify sync direction is Bidirectional
- Check conflict list for unresolved conflicts
- Review backend logs for sync errors
Recurring Tasks Missing
Symptoms: Only first instance appears
Solutions:
- Ensure client supports RRULE recurrence
- Check that
CALDAV_MAX_RECURRING_INSTANCESenvironment variable is set (default: 365) - Some clients require manual refresh to see new instances
Performance Issues
Symptoms: Sync takes very long or times out
Solutions:
- Reduce number of tasks (archive completed tasks)
- Increase
CALDAV_REQUEST_TIMEOUTenvironment variable - Lower sync frequency (change from 5 min to 15 min)
- Check server resources (CPU, memory, disk I/O)
Connection Timeouts
Symptoms: "Connection timeout" or "Network error"
Solutions:
- Verify server URL is correct and accessible
- Check firewall allows HTTPS traffic
- Ensure SSL certificate is valid (not self-signed)
- Try increasing timeout:
CALDAV_REQUEST_TIMEOUT=60000
Invalid Calendar Data
Symptoms: "Invalid VTODO" or "Parse error"
Solutions:
- Check that client sends valid iCalendar format
- Review backend logs for specific validation errors
- Test with different CalDAV client to isolate issue
- Report issue with example VTODO data
Security Considerations
Password Storage
Remote calendar passwords are encrypted with AES-256-GCM before storage. Encryption key is derived from ENCRYPTION_KEY or SECRET_KEY environment variable.
Best Practice: Use app-specific passwords instead of main account passwords when available (e.g., Nextcloud app passwords).
Authentication
CalDAV endpoints use HTTP Basic Authentication. Always use HTTPS in production to prevent credential interception.
Rate Limiting
CalDAV endpoints are rate-limited:
- 60 requests per minute for CalDAV protocol
- 5 requests per minute for manual sync triggers
Environment Variables
# Feature toggle
CALDAV_ENABLED=true
# Encryption key (32 characters minimum)
ENCRYPTION_KEY=your-256-bit-encryption-key
# Sync defaults
CALDAV_DEFAULT_SYNC_INTERVAL=15 # Minutes
CALDAV_MAX_RECURRING_INSTANCES=365 # Future instances
CALDAV_CONFLICT_RESOLUTION=last_write_wins # Strategy
# Performance tuning
CALDAV_RATE_LIMIT=60 # Requests per minute
CALDAV_MAX_SYNC_TASKS=1000 # Max tasks per sync
CALDAV_REQUEST_TIMEOUT=30000 # Milliseconds
# Debugging
CALDAV_LOG_LEVEL=info # error, warn, info, debug
CALDAV_LOG_REQUESTS=false # Log all CalDAV requests
Known Limitations
- Subtasks: Supported via RELATED-TO, but not all clients render hierarchically
- Habit Mode: Stored in custom fields, not visible in external clients
- Tags: Exported as CATEGORIES, but colors/metadata only in Tududi
- Projects: Association stored in X-TUDUDI-PROJECT-UID, not shown externally
- Status Granularity: 7 Tududi statuses mapped to 4 CalDAV statuses (some nuance lost)
- Timezone Handling: All dates stored as UTC; local timezone conversion in clients
- Large Recurring Sequences: Expanding far into future creates many VTODOs (configurable limit)
FAQs
Can I use multiple CalDAV clients simultaneously?
Yes, multiple clients can sync with the same Tududi calendar. Changes from any client will sync to all others.
What happens if I delete a task in a CalDAV client?
The task will be deleted in Tududi after the next sync (if bidirectional sync is enabled).
Can I sync multiple calendars?
Yes, you can configure multiple remote calendars in the CalDAV settings tab. Each calendar syncs independently.
Do I need a CalDAV server to use this feature?
No, you can use Tududi directly as a CalDAV server. Clients like tasks.org, Apple Reminders, and Thunderbird can connect directly to Tududi.
How do I resolve sync conflicts?
Navigate to Profile > Settings > CalDAV tab and click View Conflicts. The conflict resolver shows side-by-side comparison and lets you choose which version to keep.
Can I disable automatic sync?
Yes, set sync interval to "Manual only" in calendar settings. You can still trigger sync manually via Sync Now button.
User Features
Managing Calendars
View Calendars:
Navigate to Profile > Settings > CalDAV tab to see:
- Local calendars (Tududi as CalDAV server)
- Remote calendars (syncing with external servers)
- Sync status (last sync time, errors)
- Configuration options
Create Local Calendar:
- Click Add Calendar
- Enter calendar name and description
- Choose sync settings (enabled by default)
- Click Save
- Calendar URL:
https://your-domain.com/caldav/{username}/tasks/
Add Remote Calendar:
- Click Add Remote Calendar
- Select server type (Nextcloud, Baikal, Generic)
- Enter connection details (URL, credentials)
- Choose sync direction and interval
- Click Save and Sync Now
Edit Calendar:
- Click Edit button on calendar card
- Modify settings (name, interval, sync direction)
- Click Save
Delete Calendar:
- Click Delete button on calendar card
- Confirm deletion
- Note: Deleting a calendar does NOT delete tasks, only the CalDAV configuration
Manual Sync
Trigger Manual Sync:
- Go to Profile > Settings > CalDAV tab
- Find the calendar you want to sync
- Click Sync Now button
- Sync status updates in real-time
- Check Last Synced timestamp
View Sync Status:
Each calendar card shows:
- Last Synced: Timestamp of last successful sync
- Status: Synced, Syncing, Error
- Error Details: If sync failed, error message is displayed
Conflict Resolution
When Conflicts Occur:
A conflict happens when the same task is modified both locally (in Tududi) and remotely (in client/server) between syncs.
Automatic Resolution:
By default, last_write_wins strategy is used:
- Compare
updated_attimestamps - Keep the version with most recent change
- Discard older version
Manual Resolution:
If conflict strategy is set to manual:
- Navigate to Profile > Settings > CalDAV tab
- Click View Conflicts (if conflicts exist)
- See side-by-side comparison:
- Local Version: Current Tududi state
- Remote Version: CalDAV client/server state
- Choose resolution:
- Keep Local: Use Tududi version
- Keep Remote: Use client/server version
- Merge: (not yet implemented)
- Click Resolve
Conflict Indicators:
- Red badge on CalDAV settings tab
- Conflict count shown on calendar card
- Task marked with conflict icon (if applicable)
Support
Issues: GitHub Issues Discussions: GitHub Discussions Discord: Join our community
Related Documentation:
- Tasks Behavior
- Recurring Tasks Behavior
- User Management
- Architecture Overview
- Developer Guide: CalDAV Implementation
Protocol References:
Document Version: 1.0.0 Last Updated: 2026-04-20 Maintainer: Update when CalDAV features change