www/apps/resources/app/medusa-cli/commands/new/page.mdx
import { Table } from "docs-ui"
export const metadata = {
title: new Command - Medusa CLI Reference,
}
Create a new Medusa application. Unlike the create-medusa-app CLI tool, this command provides more flexibility for experienced Medusa developers in creating and configuring their project. It creates a monorepo structure with your Medusa backend in the apps/backend directory.
medusa new [<dir_name>]
`dir_name`
</Table.Cell>
<Table.Cell>
The name of the directory to create the Medusa application in. If not provided, you'll be prompted to enter a project name.
</Table.Cell>
<Table.Cell>
No
</Table.Cell>
<Table.Cell>
\-
</Table.Cell>
</Table.Row>
</Table.Body>
</Table> `-y`, `--useDefaults`
</Table.Cell>
<Table.Cell>
Skip all prompts, such as database prompts. A database might not be created if default PostgreSQL credentials don't work.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`--skip-db`
</Table.Cell>
<Table.Cell>
Skip database creation.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`--skip-env`
</Table.Cell>
<Table.Cell>
Skip populating `.env`.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`--db-user <user>`
</Table.Cell>
<Table.Cell>
The database user to use for database setup.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`--db-database <database>`
</Table.Cell>
<Table.Cell>
The name of the database used for database setup.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`--db-pass <password>`
</Table.Cell>
<Table.Cell>
The database password to use for database setup.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`--db-port <port>`
</Table.Cell>
<Table.Cell>
The database port to use for database setup.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`--db-host <host>`
</Table.Cell>
<Table.Cell>
The database host to use for database setup.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`--skip-migrations`
</Table.Cell>
<Table.Cell>
Skip running migrations and seeding.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`--branch <branch>`
</Table.Cell>
<Table.Cell>
The branch to clone from the starter repository.
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>medusa new my-medusa-store
After running the command, navigate to your project directory and start the development server:
cd my-medusa-store
npm run dev