Spree Custom Domains

Serve a Spree Commerce store on its own custom domain.

This extension adds:

  • A Spree::CustomDomain model and admin management UI (Settings → Domains).
  • Host-based current-store resolution, so a request to shop.example.com is served by the store that owns that domain.
  • Spree::Store#url_or_custom_domain / #formatted_url_or_custom_domain that prefer the store's default custom domain when one is configured.

Without this extension installed, Spree core serves every request from the default store and url_or_custom_domain falls back to the store's internal URL.

Installation

Add to your Gemfile:

gem 'spree_custom_domains'

Then run:

bundle install
bin/rails spree:install:migrations
bin/rails db:migrate

The spree_custom_domains table ships with Spree core, so spree:install:migrations copies it into your app if it isn't already present.

Multi-store and multi-tenant

Custom domains are independent of multi-store catalog sharing. Install this gem on its own for single-store / multi-tenant setups that just need per-store domains, or alongside spree_multi_store for legacy catalog sharing across stores.

License

Spree Custom Domains is released under the AGPL-3.0-or-later license. A commercial license is available through Spree Enterprise.