Headless Wordpress with Supabase


No, you cannot run WordPress directly on Supabase in the traditional sense. WordPress is a PHP-based content management system (CMS) that typically requires a web server (like Apache or Nginx), a PHP runtime, and a MySQL or MariaDB database to operate. Supabase, on the other hand, is an open-source backend-as-a-service platform built on PostgreSQL, providing features like a database, authentication, real-time subscriptions, and APIs—but it does not natively support running PHP applications like WordPress.
However, you can integrate WordPress with Supabase in a hybrid setup. Here’s how this might work:
Host WordPress Elsewhere: You would still need to host WordPress on a traditional server or a platform that supports PHP and MySQL/MariaDB (e.g., AWS, DigitalOcean, or a managed WordPress host like WP Engine). Supabase cannot replace this hosting environment because it doesn’t provide a PHP runtime or a web server.
Use Supabase as a Database: While WordPress traditionally uses MySQL or MariaDB, it’s theoretically possible to adapt it to use PostgreSQL (which Supabase is based on) with custom modifications. There are community efforts, like the "WordPress PostgreSQL" plugin or forks, that enable WordPress to work with PostgreSQL instead of MySQL. However, this requires significant technical expertise, and compatibility with all WordPress plugins/themes isn’t guaranteed. You could then connect this modified WordPress instance to your Supabase PostgreSQL database.
Integrate Supabase Features: A more practical approach is to run WordPress conventionally (with MySQL) and use Supabase as a supplementary backend for specific features. For example:
Store user data, custom content, or application-specific data in Supabase’s PostgreSQL database.
Leverage Supabase’s authentication system for user login/registration, syncing it with WordPress via APIs or plugins.
Use Supabase Storage for media files or backups instead of WordPress’s default filesystem.
Build real-time features (e.g., notifications or chat) into your WordPress site using Supabase’s real-time capabilities.
Headless WordPress with Supabase: Another option is to use WordPress as a "headless" CMS, where WordPress manages content via its REST API, and a separate frontend (built with a framework like Next.js or Nuxt.js) connects to Supabase for additional data storage, authentication, or real-time functionality. In this setup, WordPress handles the CMS part, while Supabase powers the backend for a custom app.
Key Considerations
Technical Complexity: Adapting WordPress to run fully with Supabase (e.g., using PostgreSQL instead of MySQL) is not straightforward and requires custom development. Most users would find it easier to keep WordPress on a standard hosting stack and integrate Supabase via APIs.
Use Case: If your goal is to replace WordPress entirely, Supabase isn’t a direct substitute—it’s a backend platform, not a CMS. You’d need to build your own frontend and content management logic.
Practicality: For most scenarios, running WordPress on a traditional host and connecting it to Supabase for specific features is more practical than trying to run it "on" Supabase.
Conclusion
You can’t run WordPress directly on Supabase as a standalone platform, but you can use Supabase alongside WordPress to enhance its capabilities. If you’re asking this because you want a CMS with Supabase, you might also consider building a custom solution using Supabase and a frontend framework, or exploring Supabase-compatible CMS alternatives like Directus or Strapi. Let me know if you’d like guidance on setting up any of these options!
Subscribe to my newsletter
Read articles from Erik Chen directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
