EverydayTech Platform - Developer Reference
Complete Source Code Documentation - All Applications
Loading...
Searching...
No Matches
WordPress DigitalOcean Spaces Configuration

Overview

Your WordPress sites are configured to use DigitalOcean Spaces (everydaytech-wordpress) for media storage with CDN enabled for faster content delivery. This ensures uploaded files persist across deployments, reduces app storage costs, and serves media through edge caching.

Environment Variables Configured

All apps have these environment variables set:

Spaces Credentials

Note: Media files are served through the CDN endpoint for improved performance and reduced load times.

WordPress Plugin Compatibility

  • AWS_ACCESS_KEY_ID: (same as DO_SPACES_KEY)
  • AWS_SECRET_ACCESS_KEY: (same as DO_SPACES_SECRET)
  • AWS_S3_BUCKET: everydaytech-wordpress
  • AWS_S3_ENDPOINT: https://syd1.digitaloceanspaces.com
  • AWS_DEFAULT_REGION: syd1

Setup Options

Option 1: WP Offload Media Lite (Recommended)

  1. Install the plugin via WordPress admin or WP-CLI:
    wp plugin install amazon-s3-and-cloudfront --activate
  2. The plugin will automatically detect the environment variables
  3. Configure via Settings > Offload Media:
  4. Enable "Remove Files From Server" to save local storage
  5. CDN Benefits:
    • Images load faster through edge caching
    • Reduced bandwidth costs
    • Better global performance
    • 1-hour cache TTL (3600 seconds)

Option 2: Media Cloud Plugin

  1. Install Media Cloud:
    wp plugin install ilab-media-tools --activate
  2. Navigate to Media Cloud settings
  3. Select DigitalOcean Spaces as provider
  4. Credentials will auto-populate from environment variables

Option 3: Manual Configuration (wp-config.php)

Add to wp-config.php:

// DigitalOcean Spaces configuration
define('AS3CF_SETTINGS', serialize([
'provider' => 'do',
'access-key-id' => getenv('DO_SPACES_KEY'),
'secret-access-key' => getenv('DO_SPACES_SECRET'),
]));
define('AS3CF_BUCKET', 'everydaytech-wordpress');
define('AS3CF_REGION', 'syd1');

Bucket Structure

Recommended folder structure in everydaytech-wordpress:

everydaytech-wordpress/
├── collegeo/
│ └── wp-content/uploads/
├── corne582/
│ └── wp-content/uploads/
├── handsofd/
│ └── wp-content/uploads/
└── [other-sites]/
└── wp-content/uploads/

CDN Configuration

For faster media delivery, configure Spaces CDN:

  1. In DigitalOcean dashboard: Spaces → everydaytech-wordpress → Settings
  2. Enable CDN
  3. Custom subdomain: cdn.everydaytech.au (requires DNS CNAME)
  4. Update WordPress plugin settings to use CDN URL

Migrating Existing Media

To migrate existing wp-content/uploads to Spaces:

# For each site
wp media regenerate --yes
wp s3-uploads migrate-attachments

Or use WP Offload Media's bulk upload tool in WordPress admin.

Permissions

The Spaces bucket should have:

  • Public Read for uploaded media (images, PDFs, etc.)
  • Private Write (only app can upload via credentials)

Configure in: Spaces → everydaytech-wordpress → Settings → File Permissions

Costs

  • Storage: $0.02/GB/month (first 250GB included with $5 base fee)
  • Bandwidth: $0.01/GB outbound
  • CDN: Free with Spaces

Typical costs per site: $0.50-2.00/month depending on media library size.

Troubleshooting

Media not uploading to Spaces

  1. Check environment variables are set: ‘wp cli eval "var_dump(getenv('AWS_ACCESS_KEY_ID’));"`
  2. Verify bucket permissions in DO dashboard
  3. Check plugin error logs in WordPress admin

Old media still on local storage

Run migration command or enable "Remove Files From Server" in plugin settings

403 Forbidden errors

  • Check bucket permissions (should be public read)
  • Verify CORS settings allow your domain

Next Steps

  1. Install WP Offload Media Lite on each site
  2. Configure to use DigitalOcean Spaces
  3. Run bulk upload for existing media
  4. Enable CDN for better performance
  5. Test uploads work correctly

Support Links