Installation
This guide covers all methods for installing and setting up a Medusa project, from the automated CLI to manual installation.Method 1: Using create-medusa-app (Recommended)
The fastest way to get started is withcreate-medusa-app, which handles project scaffolding, database setup, and initial configuration.
Prerequisites
- Node.js 20 or higher
- PostgreSQL 13 or higher
- npm, yarn, or pnpm
Installation
See the Quickstart guide for detailed walkthrough of
create-medusa-app.With Options
Customize your installation with command-line options:Method 2: Manual Installation
For more control over the setup process, you can install Medusa packages manually.Step 1: Create Project Directory
Step 2: Initialize Package Manager
Step 3: Install Core Packages
Install the Medusa framework and required dependencies:Step 4: Install Commerce Modules
Add the commerce modules you need:You can install only the modules you need. See the Commerce Modules documentation for the complete list.
Step 5: Install Development Dependencies
Step 6: Create Configuration Files
Createmedusa-config.ts in your project root:
medusa-config.ts
.env file:
.env
tsconfig.json:
tsconfig.json
Step 7: Add Scripts to package.json
Update yourpackage.json with these scripts:
package.json
Step 8: Create Source Directory
Create the basic directory structure:Step 9: Initialize Database
Run database migrations:Step 10: Start Development Server
http://localhost:9000!
Database Setup
PostgreSQL Installation
- macOS
- Ubuntu/Debian
- Windows
- Docker
Using Homebrew:Create database:
Database Connection String Format
Installing Providers
Providers extend Medusa modules with specific implementations.Payment Providers
medusa-config.ts:
medusa-config.ts
File Storage Providers
medusa-config.ts:
medusa-config.ts
Notification Providers
Admin Dashboard Setup
The admin dashboard is included by default. To customize:Install Admin SDK
Build Admin for Production
Configure Admin Path
Inmedusa-config.ts:
Environment Variables
Required Variables
.env
Optional Variables
.env
Verification
After installation, verify everything works:1. Check Server Health
2. Test API
3. Access Admin
Openhttp://localhost:9000/app in your browser.