> ## Documentation Index
> Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Spree Multi Vendor Installation

> Learn how to setup a multi-vendor marketplace with Spree

<Warning>
  This installation instructions assume you have purchased the [Spree Enterprise Edition license](https://spreecommerce.org/pricing).
</Warning>

## Prerequisites

* You need to be on Spree 5.1+, we recommend using [spree\_starter](https://github.com/spree/spree_starter) as a base for your application
* You need to have 2 environment variables set:
  * `KEYGEN_ACCOUNT_ID`
  * `KEYGEN_LICENSE_KEY`
* We support both PostgreSQL and MySQL databases
* Redis/Valkey for background jobs

<Info>
  Environment variables will be provided to you after purchasing the [Spree Enterprise Edition license](https://spreecommerce.org/pricing).
</Info>

<Warning>
  You will need to add these environment variables to your CI/CD pipeline and production environments.
</Warning>

## Installing gems

1. Add the following code to your `Gemfile`:

   ```ruby theme={"theme":"night-owl"}
   source "https://license:#{ENV['KEYGEN_LICENSE_KEY']}@rubygems.pkg.keygen.sh/#{ENV['KEYGEN_ACCOUNT_ID']}" do
     gem 'spree_enterprise'
     gem 'spree_multi_vendor'
   end
   ```

2. Install gems:

   ```bash theme={"theme":"night-owl"}
   bundle install
   ```

3. Run generators:

   ```bash theme={"theme":"night-owl"}
   bundle exec rails g spree_enterprise:install && bundle exec rails g spree_multi_vendor:install
   ```

   <Info>
     This will copy and run migrations for `spree_enterprise` and `spree_multi_vendor` gems.
   </Info>
