Knowledge Base
KamlatechToolBlogContact Us
  • Kamlatech Documentation
  • Magento
    • Installation
    • Email Configuration
  • Blogger
    • Adding Code Block
  • Linux
    • Managing Logs
    • Prevent Package Update
  • Node
    • Installation
    • Http-Server
  • Github
    • .gitignore
    • Branch to New Repo
  • HTML
    • Common Header & Footer in HTML
  • Linkedin Infographics
    • Flame Retardant Standards
    • Flame Retardant Terms
  • Music
    • Pandit Niladri Kumar - Sitar
  • Applications
    • Konvect Connect
    • Konvect Fetcher
    • Konvect Fetcher WebApp
  • HTTPS SSL Certificate
    • Lets's Encrypt
  • Oracle Cloud Instance
    • Firewall
    • CPU Stressing
    • CPU Stressing Docker
  • SFTP
    • WinSCP SFTP
  • NextCloud
    • Installation
    • Post Install Tweak
    • PHP Version
  • Wordpress
    • NGINX Configuration
    • Image upload / Crop issue
    • Required PHP Modules
    • PHP Configuration
  • Healthcare Wearables (Cardiac)
    • Wearable ECG
    • Arrhythmia
    • Ambulatory ECG Usecase
    • Understanding EKG Leads
  • Flutter
    • Direct URL Access
    • Change Android PackageName
  • Math
    • Online Equation Writing
  • Backend Web Service
    • Flask App Deployment
  • 3D Modeling
    • DWG in Solid Edge
  • MariaDB
    • MariaDB Commands
  • Excel
    • HTML as String in Excel
  • Tools
    • Online Tools
  • PostgreSQL
    • PostgreSQL Installation
  • MEDUSA
    • Medusa Installation
    • Backend Server/Worker Mode
    • Frontend Deployment
  • Jupyter Lab
    • Jupyter Web App
  • WooCommerce
    • Product Filename Renaming
  • Embedded
    • Flash Xiao Sense Bootloader
Powered by GitBook
On this page
Edit on GitHub
  1. MEDUSA

Medusa Installation

PreviousPostgreSQL InstallationNextBackend Server/Worker Mode

Last updated 6 months ago

Install Node.js (version 20 or above). Now Ubuntu will install a lower version when trying to install via - "sudo apt install nodejs" so follow the below method. You may install the latest version available by checking the download section of Node.js website.

# installs nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash

# download and install Node.js (you may need to restart the terminal)
nvm install 22

# verifies the right Node.js version is in the environment
node -v # should print `v22.10.0`

# verifies the right npm version is in the environment
npm -v # should print `10.9.0`

Next Install git CLI

sudo apt install git

For latest version you may add below PPA and update git

sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install git

Finally we will need PostgreSQL for database management -

Once PostgreSQL is installed we need to create and new user and assign superuser rights to the user. Then we need to create a new Database and make the new user, the owner of the new Database.

Go to DB console

sudo -u postgres psql

Create new user (password needs single quotes)

CREATE USER medusa WITH ENCRYPTED PASSWORD 'yourpass';

Grant SUPERUSER rights (this is needed, else Medusa installation fails while performing database migration)

ALTER USER medusa WITH SUPERUSER;
ALTER USER medusa WITH CREATEDB;

Create new database

CREATE DATABASE medusadb;
GRANT ALL PRIVILEGES ON DATABASE medusadb TO medusa;

Now we begin Medusa Installation using below command. Note we need to have a database already created in the previous step and have its user name, password and database name

npx create-medusa-app@latest --db-url "postgres://username:password@localhost:5432/database_name"
npx create-medusa-app@latest --db-url "postgres://medusa:password@localhost:5432/medusadb"

Then follow the prompt and enter your project name, whether you want to create store front (Next.js based). After about 5 - 10 minutes your installation will complete and your server will start.

click here for installation instructions