7 Ways to Optimize Your Moodle Storage and Reduce Costs in 2026
When your Moodle hosting bill keeps climbing, storage waste is usually the culprit. Forgotten course backups, uncompressed videos, and years of log data can quietly bloat a Moodle data directory to 450 GB -- 70% of which most sites don't actively need. That translates to backup windows stretching from 30 minutes to 4 hours and hosting costs inflated by 40-60%.
Here are seven strategies that actually help if you can make infrastructure changes.
Related reading: If you're planning for growth, see our guide on Scaling Your Moodle Site Without Stress and Planning Storage for Your Moodle Site.
1. Host Your Videos Externally
Your Moodle server is not a video platform. Treating it like one is the fastest way to eat through storage.
A single hour of 1080p video is 1-2 GB. A site with 50 courses and 10 hours of video per course is looking at 500-1,000 GB from video alone. Upload those same files to YouTube (unlisted), Vimeo, Microsoft Stream, or Kaltura instead, and embed them via URL or H5P.
What you get
Indicative savings vary by content mix, retention policy, and whether users already store videos externally.
- Storage: 60-80% reduction for video-heavy sites (500 GB -> 100-200 GB)
- Backup time: 70-85% faster (4 hours -> 30-60 minutes)
- User experience: adaptive bitrate streaming vs fixed-quality file serving
- Cost: video storage can drop sharply when free or already-licensed video platforms are acceptable for your use case
How to get started
- Find existing videos:
find moodledata/ -type f -name "*.mp4" -exec du -h {} + - Upload to YouTube as unlisted (free, CDN-backed, unlimited)
- Replace file resources with URL resources pointing to the video platform
- Set the maximum upload size to 100 MB site-wide to prevent future video uploads
2. Compress Images Before Uploading
One uncompressed smartphone photo is 3-8 MB. Across 500 course images, that adds up to 1.5-4 GB -- most of which compresses down to under 600 MB with zero visible quality loss.
What you get
- Storage: 70-85% reduction (4 GB -> 600-1,200 MB)
- Page load: 40-60% faster (5 seconds -> 2-3 seconds)
Recommended tools
- TinyPNG -- free, web-based, 60-80% size reduction for PNG/JPG
- Squoosh (Google) -- converts to modern formats like WebP and AVIF
- ImageOptim (Mac) / XnConvert (Windows/Linux) -- batch processing for 100+ images
Set it and forget it
- Limit image uploads to 2 MB: Site administration -> Security -> Site policies
- Add a one-page compression guide to your course creator onboarding
- Run a quarterly audit to catch and correct anything that slipped through
3. Archive and Delete Old Courses
Old courses are usually the biggest single item in your storage footprint. 200-500 MB per course, 100 courses a year, five years running -- that's 100-250 GB of data nobody's looked at since the semester ended. You're still backing it up and paying for it every month.
What you get
- Storage: reclaim 40-60% of total usage (450 GB -> 180-270 GB)
- Backup time: 50-70% faster
- Search and admin overhead: noticeably faster with fewer courses to index
Archive workflow
- Identify courses with no access in the last 12 months
- Back up via Site administration -> Courses -> Backups (.mbz format)
- Compress with 7-Zip or gzip (typically 70-85% size reduction)
- Upload compressed backup to cold storage (AWS S3 Glacier, Google Drive, or local NAS)
- Delete the live course and document it in your archive manifest
Retention policy template
- 12 months inactive: archive
- 24 months inactive: archive all completed courses unless they are marked 'evergreen'.
- 60 months: consider permanent deletion after legal retention period
4. Empty the Recycle Bin and Clear Temp Files
Deleting something in Moodle doesn't free the storage immediately. It moves to the recycle bin and sits there by default for up to 30 days. A busy site can have 5-20 GB of "deleted" files still taking up space. Temp files and cache directories pile on another 2-10 GB.
Quick wins (do these now)
- Recycle bin: Site administration -> Plugins -> Activity modules -> Recycle bin -- set retention to 7 days
- Purge caches: Site administration -> Development -> Purge all caches
Audit recycle bin size:
du -sh /var/www/moodledata/trashdir/Advanced: Automate Cleanup with Cron:
# Add to crontab for weekly recycle bin cleanup
0 2 * * 0 php /var/www/html/moodle/admin/cli/scheduled_task.php --execute=\\tool_recyclebin\\task\\cleanup_course_bin5. Fix Your Backup Retention Policy
Default Moodle backup settings keep 30+ copies. If your live site is 150 GB, that's 300-450 GB in backup files alone. Most organisations only need 7 days of recovery history -- the other 23 copies are just a waste of money.
What you get
- Backup storage: 70-85% reduction
- Backup window: 60-75% faster
Smart retention config (Site administration > Courses > Backups)
- Keep 7 daily backups (1 week of recovery)
- Keep 4 weekly backups (1 month)
- Keep 3 monthly backups (1 quarter)
- That's 14 copies instead of 30+ -- roughly 50% storage reduction right there.
Offload to cold storage
- Store backups older than 7 days on S3 Glacier Flexible Retrieval -- note that retrieval fees apply when you actually restore them.
- Use AWS S3 sync to automate backup transfer after 7 days
- 3-2-1 rule: 3 copies, 2 media types, 1 offsite
6. Set Upload Limits
Without upload limits, users treat Moodle like a personal Dropbox. One user uploading a 5 GB video collection consumes as much storage as 50 typical courses.
Configuration
- Site-wide limit: Site administration -> Security -> Site policies -> set maximum upload to 100 MB
- Private files quota: Site administration -> Plugins -> User private files -> set 50-100 MB per user
- For exceptions (video production courses, etc.), override at the course level and document why
Most routine educational files are under 100 MB. The limit stops accidental video uploads while still allowing common PDFs, images, slide decks, and assignment files.
7. Prune Log Data
1,000 active users generate up to 2,000 log entries per day. After three years, that's potentially 20 GB of log data -- most of which you'll never look at. One setting change fixes it.
What you get
- Database size: 30-60% reduction
- Report queries: 50-70% faster
Set retention (Site administration -> Server -> Cleanup)
- Log lifetime: 365 days for most organizations
- Compliance override: Adjust if FERPA, GDPR, or other regulations require longer retention
Archive before you delete:
# Export logs older than 1 year before cleanup
mysqldump moodle mdl_logstore_standard_log --where="timecreated < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 YEAR))" > archived-logs.sqlStorage Audit Checklist
Use this checklist to audit your Moodle storage and identify optimization opportunities. Run these queries and commands to build your optimization roadmap.
1. Total Storage Breakdown:
# Identify largest directories in moodledata
du -h --max-depth=1 /var/www/moodledata/ | sort -hr | head -202. Video File Audit:
# Find all video files and their total size
find /var/www/moodledata/ -type f \( -name "*.mp4" -o -name "*.mov" -o -name "*.avi" \) -exec du -ch {} + | tail -13. Image Optimization Opportunities:
# Find images larger than 2 MB (candidates for compression)
find /var/www/moodledata/ -type f \( -name "*.jpg" -o -name "*.png" \) -size +2M -exec ls -lh {} \;4. Backup Storage Analysis:
# Total backup storage consumption
du -sh /var/www/moodledata/backupdata/
# Count number of backups
find /var/www/moodledata/backupdata/ -name "*.mbz" | wc -l5. Recycle Bin Size:
# Check recycle bin storage
du -sh /var/www/moodledata/trashdir/Recommended Action Plan:
- Week 1: External video hosting (#1) + Image compression (#2) - Quick wins, 60-80% savings
- Week 2: Archive old courses (#3) + Backup policy (#5) - Reclaim 40-60% storage
- Week 3: Configure limits (#6) + Log cleanup (#7) - Prevent future waste
- Week 4: Recycle bin cleanup (#4) - Maintenance
How MooDIY Handles Storage Management
At MooDIY, storage optimization isn't something you manage - it's infrastructure we engineer.
How storage is structured
- Hot (last 30 days): NVMe SSD for active course data -- 40-60% faster than standard SSD
- Warm (31-90 days): High-performance SSD for recent content
- Cold (90+ days): Object storage for archives -- 75% cheaper than local storage
What's built in
- Image optimization: automatic WebP conversion (30-40% size reduction)
- Backup retention: 7 daily + 4 weekly + 3 monthly, auto-moved to cold storage after 14 days
- Log management: 12-month retention with archived logs offloaded to S3 Glacier
- Deduplication: SHA1 content hashing eliminates duplicate files (15-25% space savings)
Storage that grows with you
- Essentials: entry managed storage allocations for smaller teams
- Premium & Enterprise: custom allocation based on your actual usage
- Plan-level storage is scoped upfront; add-ons or unusual growth should be confirmed in the commercial agreement
- Alerts at agreed capacity thresholds with growth projections before you hit a wall
- Storage should be invisible infrastructure, not a monthly chore.
The MooDIY Difference: You shouldn't spend time running SQL queries, compressing files, and managing storage tiers. You should spend time building courses and teaching learners. We handle the infrastructure complexity. You focus on education.
Explore MooDIY Storage Plans -> Confirm current storage allowances | Automatic optimization | Managed storage planning
Related resources:
- Planning Storage for Your Moodle Site - Calculate your storage needs
- Scaling Without Stress - Infrastructure that grows with you
- Free Migration Service - We handle the heavy lifting
Frequently Asked Questions
Q: How much storage does a typical Moodle course use? A: A typical text-based course with PDFs and images uses 50-200 MB. Courses with student assignments and forums grow to 200-500 MB. Video-heavy courses without external hosting can consume 2-10 GB per course.
Q: What percentage of Moodle storage is usually wasted? A: Without optimization, 40-70% of storage is typically waste: forgotten course backups (20-30%), unoptimized images (10-15%), videos that should be externally hosted (30-60%), and historical logs (5-10%).
Q: Can I implement these optimizations on a live Moodle site? A: Yes, these strategies can be applied safely with the right change process. Start with low-risk optimizations (#1 external videos, #2 image compression, #4 recycle bin cleanup) before tackling higher-impact changes like archiving courses or implementing ObjectFS.
Q: How long does ObjectFS migration take? A: For a 1 TB site, expect 7-14 days for complete migration. The process runs in the background without downtime. New files go to object storage immediately; existing files migrate gradually.
Q: Will users notice any difference after implementing these optimizations? A: Users will notice better performance: faster page loads (optimized images), better video streaming (external hosting), and faster site search (fewer archived courses). They won't notice storage changes because files remain accessible exactly as before.
Q: What's the ROI timeline for storage optimization? A: Immediate: External video hosting and image compression provide instant savings. 30 days: Backup and archive cleanup shows full ROI. 90 days: ObjectFS implementation breaks even (if storage >500 GB).
Q: Should I optimize storage before or after a Moodle upgrade? A: Before upgrading. A leaner site means faster upgrade times (30-50% reduction), smaller pre-upgrade backups, and easier rollback if needed.
Q: How often should I run storage audits? A: Quarterly audits for sites <500 GB. Monthly audits for rapidly growing sites (>20% growth/year) or sites approaching storage limits. Use the checklist above to identify new optimization opportunities.
